lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Socket API thread safe?


From: Jani Monoses
Subject: Re: [lwip-users] Socket API thread safe?
Date: Tue, 8 Jun 2004 14:32:29 +0300

> As the subject already shows I wonder if the lwIP socket API is multi thread
> safe.
> 
> I remember having read somewhere it is, but can’t find that statement back.
> 
> As I’m hunting a race condition in my environment using lwIP + socket API, I
> wonder if the problem my lay in the fact I’ve two threads calling the socket
> API (one for sending using sendto and one for receiving using recvfrom).
> 
> I already found out that the sys_sem_wait() function sys.c is sometimes
> re-entered (about once a hour), which it doesn’t seem to be designed for

In theory the socket API is thread safe because every thread goes through
tcpip_input and uses message boxes for communication.
But it could be that some socket structures are not protected as you say by
sys_sem_wait or sys_sem_wait has a bug (what platform?).
If you have a testcase and could reproduce the problem on a platform others
have access to you may get more help.

Jani




reply via email to

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