Thread debug options

The pthreads library maintains a list of active mutexes, condition variables, and read-write locks for use by the debugger.

When a lock is initialized, it is added to the list, assuming that it is not already on the list. The list is held as a linked list, so determining that a new lock is not already on the list has a performance implication when the list gets large. The problem is compounded by the fact that the list is protected by a lock (dbx__mutexes), which is held across the search of the list. In this case other calls to the pthread_mutex_init() subroutine are held while the search is done.

If the following environment variables are set to OFF, which is the default, then the appropriate debugging list will be disabled completely. That means the dbx command (or any debugger using the pthread debug library) will show no objects in existence.

  • AIXTHREAD_MUTEX_DEBUG
  • AIXTHREAD_COND_DEBUG
  • AIXTHREAD_RWLOCK_DEBUG
To set any of these environment variables to ON, use the following command:
# export variable_name=ON