AW: AW: Assertion : "tcp_enqueue: no pbufs on queue=>bothqueues empty"

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

AW: AW: Assertion : "tcp_enqueue: no pbufs on queue=>bothqueues empty"

Amir Bukhari-4
I am not familiar with lwip internal, what I can do here. Which part I should make it thread safe (not necessary all parts).
I want to a void a deadlock when doing thread safe. In my example when one of the task access lwip part it should not wait for an event as this will case the others task to wait.

When I use socket API! All commutations goes throw messages which in this case call my OS layer and that part is thread safe. tcp_enqueue() get called from different parts, but whether it got called from my  2 task I suspect!!



-----Urspr├╝ngliche Nachricht-----
Von: lwip-users-bounces+bukhari=[hidden email] [mailto:lwip-users-bounces+bukhari=[hidden email]] Im Auftrag von Kieran Mansley
Gesendet: Dienstag, 31. Oktober 2006 12:29
An: Mailing list for lwIP users
Betreff: Re: AW: [lwip-users] Assertion : "tcp_enqueue: no pbufs on queue=>bothqueues empty"

On Tue, 2006-10-31 at 12:23 +0100, Amir Bukhari wrote:
> Yes, I have 2 real time task which access the same connection, but one only sends and the second task read and send data.
>
> This case should not case an assertion, its application problem to handle such case, but TCP/IP stack should not be affected with such or I am wrong
>
> What can happened if both queue is embty, does lwip will crash?

Your port of lwIP should ensure that there is only one thread in the
lwIP core code at any one time.  lwIP is not thread safe I'm afraid.
The consequences of having two threads concurrently active in the stack
are many and varied, but all bad.

Kieran



_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users


_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: AW: Assertion : "tcp_enqueue: no pbufs onqueue=>bothqueues empty"

Mumtaz Ahmad
Simple method to make it thread safe is to protect all the stack enteries by
a mutex  so that any thread trying to call any function of stack must
acquire this mutex first to get in.



----- Original Message -----
From: "Amir Bukhari" <[hidden email]>
To: "Mailing list for lwIP users" <[hidden email]>
Sent: Tuesday, October 31, 2006 5:29 PM
Subject: AW: AW: [lwip-users] Assertion : "tcp_enqueue: no pbufs
onqueue=>bothqueues empty"


> I am not familiar with lwip internal, what I can do here. Which part I
should make it thread safe (not necessary all parts).
> I want to a void a deadlock when doing thread safe. In my example when one
of the task access lwip part it should not wait for an event as this will
case the others task to wait.
>
> When I use socket API! All commutations goes throw messages which in this
case call my OS layer and that part is thread safe. tcp_enqueue() get called
from different parts, but whether it got called from my  2 task I suspect!!
>
>
>
> -----Urspr├╝ngliche Nachricht-----
> Von: lwip-users-bounces+bukhari=[hidden email]
[mailto:lwip-users-bounces+bukhari=[hidden email]] Im Auftrag von
Kieran Mansley
> Gesendet: Dienstag, 31. Oktober 2006 12:29
> An: Mailing list for lwIP users
> Betreff: Re: AW: [lwip-users] Assertion : "tcp_enqueue: no pbufs on
queue=>bothqueues empty"
>
> On Tue, 2006-10-31 at 12:23 +0100, Amir Bukhari wrote:
> > Yes, I have 2 real time task which access the same connection, but one
only sends and the second task read and send data.
> >
> > This case should not case an assertion, its application problem to
handle such case, but TCP/IP stack should not be affected with such or I am
wrong

> >
> > What can happened if both queue is embty, does lwip will crash?
>
> Your port of lwIP should ensure that there is only one thread in the
> lwIP core code at any one time.  lwIP is not thread safe I'm afraid.
> The consequences of having two threads concurrently active in the stack
> are many and varied, but all bad.
>
> Kieran
>
>
>
> _______________________________________________
> lwip-users mailing list
> [hidden email]
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>
>
> _______________________________________________
> lwip-users mailing list
> [hidden email]
> http://lists.nongnu.org/mailman/listinfo/lwip-users



_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users