DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Threads

Managing thread scheduling

The initial thread of a newly executing program (a process returning from exec(2)) is always a multiplexed thread running under the SCHED_TS policy. The scheduling characteristics of new threads are generally derived from the creator thread. (There are some interesting variations when a bound thread creates a multiplexed thread and vice versa. See the thr_create(3thread) manual page for details.)

To create a thread with different scheduling characteristics the programmer can:

  1. Create a new thread with thr_create(3thread) using the THR_SUSPENDED flag. This will create a new thread but not allow it to execute.

  2. Use the returned thread ID to change the characteristics of the new thread with the thr_setprio(3thread) or thr_setscheduler(3thread) functions.

  3. Use the thr_continue(3thread) function to make the new thread runnable.

Alternatively, a thread can use thr_setscheduler(3thread) or thr_setprio(3thread) to modify its own scheduling class or priority.


Next topic: Synchronizing threads
Previous topic: Bound thread scheduling

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004