lwip-users
[Top][All Lists]
Advanced

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

Re: Antw: RE: [lwip-users] SemSignal gets called on aalreadysignaled sem


From: Jonathan Larmour
Subject: Re: Antw: RE: [lwip-users] SemSignal gets called on aalreadysignaled semaphore
Date: Thu, 31 May 2007 15:29:16 +0100
User-agent: Thunderbird 1.5.0.10 (X11/20070301)

Goldschmidt Simon wrote:
I stepped a little bit around now. The semaphore causing the problem is created inside the accept_function() in api_msg.c line 242:

newconn->sem = sys_sem_new(0);

It is then signaled in sent_tcp() in api_msg.c line 159. But I can't find the file where this (connection specific) semaphore is ever waited on. So it gets signaled and signaled and signaled....

That conn->sem seems only to be waited for when running out of memory.
If you always send so little data that you never run out of memory
(or window size), it never gets waited for. Can any other developer
say something on this? I think this behaviour is strange...

I agree. It is treating it as a binary semaphore.

It turns out sys_arch.txt says "Semaphores can be either counting or binary - lwIP works with both kinds."

And my own port uses a counting semaphore. But the situation that would tickle this problem would probably be infrequent in practice, but certainly would appear to happen sometimes.

I've had a quick look and I can't see any dependencies elsewhere on it being a counting semaphore. So perhaps the answer is that we must mandate a binary semaphore after all.

Jifl
--
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["The best things in life aren't things."]------      Opinions==mine




reply via email to

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