lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] SOCK_RAW


From: lukem . lwip
Subject: Re: [lwip-users] SOCK_RAW
Date: Tue, 2 Mar 2004 15:37:39 +1100 (EST)

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




reply via email to

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