[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] threading issues with sockets
From: |
Simon Goldschmidt |
Subject: |
Re: [lwip-users] threading issues with sockets |
Date: |
Wed, 20 Jun 2012 13:35:12 +0200 |
"Åke Forslund" <address@hidden> wrote:
> I'm not quite sure how to handle the situation since when using blocking
> sockets lwip_read() doesn't return even if the link goes down (? is this
> expected behavior?)
A link-down event shouldn't cause read() to abort, I guess, since you could
re-plug the device into the same network again.
A netif-down event (which is what stopping DHCP does) however should cause the
read() to abort since the IP address is gone.
> so I can't use a semaphore to ensure that socket functions
> can't be accessed at the same time as the netifapi_*()-functions.
>
> Any advice on how to handle link-status changes together with sockets in a
> safe manner would be great.
I'm not aware of problems here. As far as I know, there should be no problems
with what you described. As you are having problems, I don't have any
suggestions except for debugging to see which threads are pending on which
semaphores, I'm afraid. A stack trace of all threads at the time of suspected
deadlock would be helpful to give more hints.
Simon
--
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de