[omniORB] SocketCollection bug

Duncan Grisby duncan at grisby.org
Tue Jan 19 09:08:42 GMT 2010


On Sat, 2010-01-16 at 12:51 -0800, Martin Kocian wrote:

> 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.

What platform are you using?

select() returns if one of the file descriptors in the read set can be
read without blocking. That doesn't change whether another thread doing
recv() is able to actually read the data. It would certainly be bad to
have two threads doing recv() on the same socket, but select() doesn't
consume any data, so it shouldn't prevent recv() from returning. What
diagnosis have you done to show that the problem you describe is
actually what is happening?

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --





More information about the omniORB-list mailing list