[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] SOCK_RAW
From: |
Ed Sutter |
Subject: |
Re: [lwip-users] SOCK_RAW |
Date: |
Tue, 02 Mar 2004 10:43:45 -0500 |
Thanks for the information.
I'm considering converting the stack in MicroMonitor over to LWIP
using the state machine model. I haven't done anything thus far
with that API, so I suppose I need to start!
I'm sure the answer to this is no (since the sockets API uses the
sequential API), but I'll ask anyway...
Is there any reason why a mix of both sockets and sequential API
cannot be run within the same application?
Ed
address@hidden wrote:
>
> On Fri, 27 Feb 2004, Ed Sutter wrote:
> > Assuming the sluggishness is in fact due to the sockets layer, has
> > anyone considered improving it or does the underlying design of the
> > sequential API just make it difficult to implement an efficient
> > sockets layer on top of it?
>
> I havn't looked at or used the socket emulation layer, but I am familiar
> with BSD sockets generally, and here are some of the problems I can think
> of generally...
>
> 1) The socket API requires copy of received packets
> 2) The socket API requires additional synchronisation and threads
> 3) The socket API lends itself to implementations which use a large number
> of threads (Though this can be avoided with poll).
> 4) Polling sucks.
> 5) Using extra threads means you incur context switch overheads
> 6) Although not strictly necessary, it is would be difficult to implement
> the socket layer without adding an extra layer of buffering between the
> application and the IP stack.
>
> The native interface is vastly more elegant than BSD sockets from a design
> perspective, though I wouldn't make any claims about it being perfect. You
> just need to learn to think in terms of state machines rather than threads
> to make it work well.
>
> What we really need is more applications which support the native interface!
>
> --
> Luke