[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [lwip-users] Socket API thread safe?
From: |
Wilfred Hoogerbrugge |
Subject: |
RE: [lwip-users] Socket API thread safe? |
Date: |
Tue, 8 Jun 2004 14:30:27 +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
>
I have implemented the lightweight protection mechanism. Contained a bug
first time, but is fine now (had it reviewed by someone else).
Your comment on sys_sem_wait makes sense, I didn't take in account timeouts
are stored per thread.
Thanks,
Wilfred
- [lwip-users] Socket API thread safe?, Wilfred Hoogerbrugge, 2004/06/08
- Re: [lwip-users] Socket API thread safe?, Jani Monoses, 2004/06/08
- Re: [lwip-users] Socket API thread safe?, pgraf, 2004/06/08
- RE: [lwip-users] Socket API thread safe?,
Wilfred Hoogerbrugge <=
- Re: [lwip-users] Socket API thread safe?, K.J. Mansley, 2004/06/08
- Re: [lwip-users] Socket API thread safe?, Leon Woestenberg, 2004/06/08
- Message not available
- RE: [lwip-users] Socket API thread safe?, Wilfred Hoogerbrugge, 2004/06/21