Thread scheduling

You can use the pthread_attr_setweight_np() and pthread_attr_setsynctype_np() functions to establish priorities for threads. The pthread_attr_setweight_np() threadweight variable can be set to the following:
__MEDIUM_WEIGHT
Each thread runs on a task. When the current thread exits, the task waits for another thread to do a pthread_create(). The new thread runs on that task.
__HEAVY_WEIGHT
The task is attached on pthread_create() and terminates when the thread exits. When the thread exits, the associated task can no longer request threads to process, and full MVS™ EOT resource manager cleanup occurs.

You can use the pthread_addt_setsynctype_np() function to set the __PTATASYNCHRONOUS value. This enables you to create more threads than there are TCBs available. For example, you could run 50 TCBs and create hundreds of threads. The kernel queues the threads until a task is available. This frees your application from managing the work. While a thread is queued and not executing on an MVS task, you can still interact with the thread via pthread functions, such as pthread_join() and pthread_kill().