next up previous contents index
Next: 18.3.3 pthread_attr_init: Initialize a Up: 18.3 POSIX Threads Reference Previous: 18.3.1 pthread.h: Thread constants

18.3.2 pthread_init: Initialize the threads system

 

SYNOPSIS

#include <oskit/threads/pthread.h>

void pthread_init(int preemptible);

DESCRIPTION

This function initializes the threads system. It should be called as the first function in the application's main program function.

When pthread_init returns, the caller is now running within the main thread, although on the same stack as when called. One or more idle threads have also been created, and are running at low priority. At this point, the application is free to use any of the pthread interface functions described in this section.

PARAMETERS

preemptible
A boolean value specifying whether the threads system should use preemption based scheduling. When preemption based scheduling is not used, it is up to the application to yield the processor using sched_yield as necessary.



University of Utah Flux Research Group