Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (n - p) pthread_create(2)
NAME
pthread_create - Creates a thread
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
32-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/zputdll
64-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/yputdll
H-series and J-series OSS processes that use the Standard POSIX Threads library:
/G/system/zdllnnn/zsptdll
SYNOPSIS
#include <pthread.h> | #include <spthread.h>
/* pthread.h is required to use POSIX User Thread Model library */
/* spthread.h is required to use Standard POSIX Threads library */
int pthread_create(
pthread_t *thread,
const pthread_attr_t *attr,
void * (*start_routine) (void *),
void *arg);
PARAMETERS
thread Specifies the location to receive the identifier for the thread being created.
attr Specifies the thread attributes object that defines the characteristics of the thread
being created. If you specify NULL, then the default attributes are:
SCHED_FIFO
The default scheduling policy for the schedpolicy attribute is
first-in, first-out.
PTHREAD_CREATE_JOINABLE
The default detachstate is joinable.
For the Standard POSIX Threads library, you can also specify
pthread_attr_default to set these default attributes.
A thread is detached when created if the detachstate attribute of its thread object
is set to PTHREAD_CREATE_DETACHED.
start_routine Specifies the function to be executed as the new thread’s start routine.
arg Specifies the argument to the thread’s start routine.
DESCRIPTION
This function creates a thread, which is a single, sequential flow of control within a program. A
thread is the active execution of a designated routine, including any nested routine invocations.
Successful execution of this function causes the following actions:
• The system creates a thread object to describe and control the thread.
• The thread parameter receives an identifier for the new thread.
527186-023 Hewlett-Packard Company 5−101