[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Socket API thread safe?
From: |
pgraf |
Subject: |
Re: [lwip-users] Socket API thread safe? |
Date: |
Tue, 08 Jun 2004 14:00:08 +0200 |
Wilfred Hoogerbrugge wrote:
> As the subject already shows I wonder if the lwIP socket API is multi
> thread safe.
>
> I remember having read somewhere it is, but cant find that statement back.
>
> As Im hunting a race condition in my environment using lwIP + socket API,
> I wonder if the problem my lay in the fact Ive 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 doesnt seem to be designed for
> (?).
>
> Thanks for reading (and answering).
>
> BTW: Im using lwIP 0.7.1
I'm using the sockets API with several threads simultanously under QDOS
(web server, browser, mailclient, TCP echo, etc.) and have little to no
problems since I implemented the "lightweight protection" mechanism for
the lower level.
sys_sem_wait() looks OK for being re-entered by a different thread, since
sys_arch_timeouts() provides the timeouts for the _current_ thread only.
I vaguely remember a similar problem to yours from the early days when my
sys_arch_sem_wait() implementation had a tricky little bug. This looks
like the first place to check.
All the best
Peter