ThreadLock blocks when writeLock() called recursively
GNU Telephony Services and Applications
Brought to you by:
dyfet
Symptom: ThreadLock::writeLock blocks after second call.
Problem: Certain implementations of pthreads read write
locks default initialization will block on recursive
calls to 'pthread_rwlock_wrlock'.
Platform: 'pthread_rwlock_wrlock' in libc6 v2.3.5-6 as
distributed with Debian GNU/Linux is NOT recursive.
This applies both to LinuxThreads and NPTL.
Possible solutions:
1. fix NPTL.
2. write a workaround using mutexes.
Low priority, I think...
Logged In: YES
user_id=72684
After looking at NPTL source, NPTL is
optimized--simplified?--for speed. Recursive write locks
(in NPTL) are possible, simple even, but promotion from a
read lock to a write lock is a complicated endeavour, and
not worth the cost (proccesor time & memory?).
Using rwlocks (on the Linux platform) from pthreads allows
for a high speed solution at the cost of recursivity.
I find this very frustrating, but understand the tradeoff.
This should probably be tabled for the moment.