lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Overview of mboxes


From: K.J. Mansley
Subject: Re: [lwip-users] Overview of mboxes
Date: 29 Nov 2004 09:19:30 +0000

On Mon, 2004-11-29 at 02:46, Chris Frost wrote:
> I was wondering if someone might be able to give me/point me towards
> just a short overview of the purpose of mboxes in lwip? For example,
> are they for intrathread communication only? Interthread? 
> Interprocess? (If interprocess, is each mailbox global?)

They are generally used for inter-thread communication.

> Just a
> little bit of a high level overview would be very helpful, I hope to
> be able to dive in with such very appreciated help.
> 
> Related, I'm not clear on whether thread support, or when thread support, is
> needed. Are there non-performance reasons (features?) for making
> thread support available? I'd like to use lwip as a network stack
> running in one process with other processes being able to use it for
> network communication, I don't know if this affects the answer to this
> question?

Put simply, thread support is needed if you want to use the Sockets
API.  If you're happy to interface at a lower level, in a non-standard
way (using the Raw API - calling things like "tcp_write()" directly),
you should be able to manage without threads completely.

To communicate between processes may be a little more tricky.  Obviously
if your OS supports them, you could use any of the normal IPC
techniques.  You may be able to use mboxs as well (functionally they
should do the job) but they'd need to reside in a region of shared
memory and so on, which isn't currently provided by lwIP.

One other thing that you may encounter is you'll need to ensure that you
serialise access to the lwIP process, from both above (the application
sending data) and below (the network delivering data).  This is a common
problem that people encounter when first using the stack as it does not
protect itself against concurrent access.

Hope that helps,

Kieran





reply via email to

[Prev in Thread] Current Thread [Next in Thread]