Martin Kocian
2010-01-17 02:51:21 UTC
Hi,
When I run omniorb a thread will sometimes hang. I traced this to a
conflict between one thread doing a blocking read in tcpConnection::Recv
and another thread doing a blocking select call in the posix
implementation of SocketCollection::Select.
If both threads are listening to the same socket and data arrives then
only one of the two threads gets woken up. If Recv gets woken up then it's
fine because there is a timeout on Select, but if it's
the Select thread that gets woken up then Recv will block indefinitely.
Please correct me if I'm wrong but as far as I know BSD sockets do not
allow several threads to do blocking select/read calls on the same socket
at the same time in which case this is a bug in omniorb. The omniorb release
I'm using is 4.1.4.
Thank you,
Martin
When I run omniorb a thread will sometimes hang. I traced this to a
conflict between one thread doing a blocking read in tcpConnection::Recv
and another thread doing a blocking select call in the posix
implementation of SocketCollection::Select.
If both threads are listening to the same socket and data arrives then
only one of the two threads gets woken up. If Recv gets woken up then it's
fine because there is a timeout on Select, but if it's
the Select thread that gets woken up then Recv will block indefinitely.
Please correct me if I'm wrong but as far as I know BSD sockets do not
allow several threads to do blocking select/read calls on the same socket
at the same time in which case this is a bug in omniorb. The omniorb release
I'm using is 4.1.4.
Thank you,
Martin