pthread_create(3P)

pthread_create - create and start a thread

As shipped in IRIX 6.5. First release of IRIX 6.5.

NAME
     pthread_create - create and start a thread

C SYNOPSIS
     #include <pthread.h>

     int pthread_create(pthread_t *thread, pthread_attr_t *attr,
          void *(*start)(void *), void *arg);

DESCRIPTION
     The pthread_create() function creates a thread with the attributes
     specified by attr, starting execution at the function named start with
     the argument value arg.  A null value of attr causes the thread to be
     created with default attributes.  The thread identity is saved in the
     location pointed to by the thread argument.

     A new thread inherits its per-thread signal mask from its creator.  No
     signals are pending on the thread when it starts.  The thread runs until
     it returns from its start function, calls pthread_exit(), or acts on a
     cancellation request.  The exception is the initial thread which will
     cause the process to exit if it returns from main().  When the process
     terminates so do all its threads.

     For an overview of POSIX threads see pthreads(5).

DIAGNOSTICS
     On success, pthread_create() returns zero; otherwise an error number is
     returned:

     [EAGAIN]       The maximum number of threads has been created [see NOTES,
                    and setrlimit()] or there is insufficient memory to create
                    the thread.

     [EPERM]        The calling process lacks sufficient privilege to create a
                    thread with these attributes [see
                    pthread_attr_setscope()].

SEE ALSO
     pthread_attr_init(3P), pthread_attr_setscope(3P), pthread_exit(3P),
     pthreads(5), setrlimit(2), sysconf(3C).

NOTES
     A thread application can find the thread limit using the sysconf()
     function with the _SC_THREAD_THREADS_MAX option.