[omniORB] omniORB, posix rwlock_t and deadlock
Attila Pletyak
attila.pletyak@anemo.com
Tue, 12 Jun 2001 13:36:07 +0200
Hello,
We have encountered a problem what I do not really understand. Maybe
it lies in omniORB, maybe not. The situation is the following:
When I use rwlock_t types in my distributed corba system, at some
point the system locks, dunno why. I have narrowed the problem to the
following:
one servant gets a request and makes a w lock on itself, and also a w
lock on it's so-called base class, which is shared amongst several other
servers (using the C++ & operator, they get a reference to the base
servant). While having the w lock, an other request is coming in
directly to the base class. It waits for a w lock possibility. The first
w lock unlocks, the second starts its work, but a new request is coming
in which works like the first. Let's call it the third one. Now, the
second W lock finishes, the function returns from the base class, the
lock unlocks. But the third lock request is waiting and waiting and
waiting... never gets to work again.
There is a wrapper class around the pthread_rwlock_t types, so they
get unlocked in every case.
As I know that omniORB is doing thread operations (creating and
deleting threads all the time) I started to be curious if omniORB is at
fault or my code.
Does anyone has experience with such a thing? Is there an omniORB
specific thread synchronization tool which works like the rwlock?
Previously I used the omni_mutex, but it was slow as in the base class
there is only reading in the majority of the time.
All this is going with omniORB 3.03, Debian Linux 2.2 and C++
Thanks in advance,
Attila Pletyak