Forcing 1:1 Thread Scheduling Mode on RS/6000 Systems

Due to limitations in the pthread and pthread debug libraries, you cannot reliably debug pthread programs in process contention scope (M:N thread scheduling). IBM is working to correct this problem, but meanwhile you should force the pthread debug library to run in system contention scope (1:1 thread scheduling).

To successfully debug an AIX pthreads program, you must turn off the pthreads scheduler by:

  • Setting the environment variable AIXTHREAD_MNRATIO to 1:1.
     
  • Setting the environment variable AIXTHREAD_SLPRATIO to 1:1.
     
  • Setting the environment variable AIXTHREAD_SCOPE to S, or modifying your program. The AIX documentation states:

    "AIXTHREAD_SCOPE={P|S}, where P signifies process based contention scope and S signifies system based contention scope. Either P or S should be specified. The braces are provided for syntactic reasons only. The use of this environment variable impacts only those threads created with the default attribute. The default attribute is employed, when the attr parameter to pthread_create() is NULL."

    "If you do not pass a NULL to the pthread_create() function, you must change your program and rebuild it to set the contention scope of created threads to system scope.

    "For example:

    pthread_attr_t attr;
    pthread_attr_init (&attr);
    pthread_attr_setscope (&attr,
            PTHREAD_SCOPE_SYSTEM);
    pthread_create (&tid, &attr, worker_function, 0);

    "This forces the scheduler to keep exactly as many kernel threads as user threads, and to eliminates the problems we have seen with the library.

For more detailed information, see your AIX 4.3 documentation or use the web links to the IBM AIX 4.3 documentation site listed below:

 
 
 
 
support@etnus.com
Copyright © 2001, Etnus, LLC. All rights reserved.
Version 5.0.0-1