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: Wilfred Hoogerbrugge
Subject: RE: [lwip-users] Socket API thread safe?
Date: Mon, 21 Jun 2004 09:48:38 +0200

Hello group,

About two weeks ago I posted this question.

First I would like to tank everyone who responded and lead me into the right
direction.

I finally got rid of the problem by doing the following:
- Create an extra socket, now one socket is used for sending, one for
receiving.
- Still got (after running for a few hours) an assertion (pbuf free while
refcount > 0).
- The sendto function is called in my code from two threads, I added a mutex
to protect this call.
- Now the code didn't crash or assert anymore, but after a few hours of
running, no further transmissions were possible.
- This turned out to be caused by running out of memory blocks. Using the
statistics I invested which type of memory was low and altered some setting
in lwip-opts. After this it is rock solid! (had an very heavy load test
running this weekend and it still runs).

So, thanks for all the support and hopefully this info can help someone else
having the same problems.

Kind regards,

Wilfred

> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden
> rg]On Behalf Of Wilfred Hoogerbrugge
> Sent: dinsdag 8 juni 2004 13:29
> To: address@hidden
> Subject: [lwip-users] Socket API thread safe?
>
>
> Hello group,
>
> 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
> (?).
>
> Thanks for reading (and answering).
>
> BTW: I’m using lwIP 0.7.1
>
> Wilfred Hoogerbrugge
>
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users





reply via email to

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