lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] threads question


From: Martin Glunz
Subject: [lwip-users] Re: [lwip] threads question
Date: Thu, 09 Jan 2003 00:47:27 -0000

Tim Newsham wrote:
> 
> Hi,
>    I'm porting lwIP to a system and I have some questions reguarding
> threads.  I will have a seperate thread handling the timers
> (tight loop with sleeps and calls to the arp and tcp timer functions),
> a seperate thread doing ethernet reads (blocking read on an ethernet
> device) and a seperate thread waiting for user requests and processing
> them through the IP stack (ie. create tcb, bind to port, establish
> connection..).
> 
...
> 
>    - Is lwip designed to be able to handle multiple threads in
>      this manner (at first glance it doesnt seem to).
>    - should I just have a big lock that all threads grab before
>      calling into lwip functions?
>    - should I just define away the sys_sem_t operations as nops
>      when using the big lock?
> 

As far as I understood the concept of lwip (I just started
porting it to my system) the ethernet receiver may be
handled in a seperate thread. The unixsim example does
it exactly this way.

I don't know if it it is easily possible to treat the timers
your way.

The semaphores and mailboxes are used to synchronize the
core functions and the sequential api. The mailboxes are not
necessary if you use the raw api, but locking by
semaphores or your own lock should be done if the ethernet
receiver runs as a seperate thread.


Martin Glunz
[This message was sent through the lwip discussion list.]




reply via email to

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