NAME
mthr_startup - start the mthreads userlevel thread package

mthr_halt - call the shutdown handler and terminate the application

SYNOPSIS
#include <mthread.h>

void mthr_startup(void);

void mthr_halt(int exitvalue);

DESCRIPTION
When mthr_startup() is called, the former standard UNIX process is converted to a multithreaded process. Except otherwise configured via mthr_config(3) or mthr_configv, one kernelthread will be started for each processor of each node in the subcomplex where the application has been started. Userlevel threads will be scheduled onto this virtual processors. Moreover pools for efficient allocation of all necessary structures, like thread structures, synchronization mechanisms etc. will be built.

Although it's possible to terminate the multithreaded application by a call to exit(3), it may be advantageous to terminate the application with a call to the shutdown handler which can be set by mthr_set_shutdownhandler. mthr_halt() will terminate the application by calling the shutdown handler and exiting the application with the value given by exitvalue. This function is also internally called by the thread package when the last userlevel thread terminates.

SEE ALSO
mthreads(3), mthr_config(3), mthr_configv(3), mthr_set_shutdownhandler(3)