#14 ThreadLock blocks when writeLock() called recursively

Library (32)

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


  • Scott Bailey

    Scott Bailey - 2005-10-25

    Logged In: YES

    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

Log in to post a comment.