lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] lwip deadlock in tcpip_apimsg using FreeRtos ST Arm Por


From: Simon Goldschmidt
Subject: Re: [lwip-devel] lwip deadlock in tcpip_apimsg using FreeRtos ST Arm Port with lwip sockets
Date: Sat, 24 Jan 2009 17:30:22 +0100

> Simon wrote before that:
> >This could be easier to solve if we had one semaphore for read actions and
> >one for write actions. Still I have to disappoint you about a planned fix
> >for this. The current position of lwIP is just 'not supported'! :-(
> 
> I didn't say this in my earlier reply in this thread, but I'm not sure how
> you can be sure you are waking up the correct thread with a single 
> semaphore for each of reads and writes. You might wake up a thread which 
> had attempted to write data, but that data has not yet been accepted by 
> the stack due to being out of send buffer space, for example. You'd want 
> to wake up the oldest waiting thread whose write has actually made it into
> the stack. Hence my suggested alternative.

That idea was for one thread reading and one thread writing. It doesn't work 
with more threads than that, of course! Maybe this is not enough for everyone, 
but it could be a simple change to the existing solution that only requires one 
more semaphore per socket/netconn and not much more code, I guess.

But your idea of having a pool of semaphores also looks quite nice to me.

Unfortunately, I don't have much time for lwIP at the moment to take a closer 
look on implementing this. And I'm not even that keen on supporting 
thread-safeness here: it's a nice thing to have and some people may need it, 
but at least I currently don't! :-)


Simon
-- 
NUR NOCH BIS 31.01.! GMX FreeDSL - Telefonanschluss + DSL 
für nur 16,37 EURO/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a




reply via email to

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