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(S)) 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(S) manual page for details.)

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

  1. Create a new thread with thr_create(S) 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(S) or thr_setscheduler(S) functions.

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

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


Next topic: Synchronizing threads
Previous topic: Bound thread scheduling

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005