#14 ThreadLock blocks when writeLock() called recursively

Common_Libraries
closed
David Sugar
Library (32)
1
2007-01-24
2005-10-25
Scott Bailey
No

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

Discussion

  • Scott Bailey
    Scott Bailey
    2005-10-25

    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.

     
  • Scott Bailey
    Scott Bailey
    2005-10-25

    • priority: 5 --> 1
     
  • David Sugar
    David Sugar
    2006-06-11

    • assigned_to: nobody --> dyfet
     
  • David Sugar
    David Sugar
    2007-01-24

    • status: open --> closed