*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> pthread_create (3p)              
Title
Content
Arch
Section
 

Contents


pthread_create(3P)					    pthread_create(3P)


NAME    [Toc]    [Back]

     pthread_create - create and start a thread

C SYNOPSIS    [Toc]    [Back]

     #include <pthread.h>

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

DESCRIPTION    [Toc]    [Back]

     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    [Toc]    [Back]

     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()].

     [EPERM]	    A call to pthread_create() was attempted from a sproc
		    program (see CAVEATS, section below).

     [EPERM]	    A call to pthread_create() was attempted with a priority
		    that is outside of the valid range (see CAVEATS, section
		    below).

     [ENOSYS]	    A call to pthread_create() was made	from an	executable
		    which is not linked	against	the POSIX threads library.
		    This typically occurs when the argument "-lpthread"	is
		    accidentally omitted during	compilation of the executable.







									Page 1






pthread_create(3P)					    pthread_create(3P)



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

CAVEATS    [Toc]    [Back]

     The POSIX thread model is incompatible with the sproc(2) model of
     threading.	 Attempts to create a pthread process from a sproc program
     will be rejected.

     Attempts to create	a pthread process at a priority	outside	of the valid
     range will	be rejected.  Specifically, weightless is not a	valid pthread
     priority.

     For more information about	these and other	limitations with the POSIX
     thread model see pthreads(5).

SEE ALSO    [Toc]    [Back]

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


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
pthread_create FreeBSD create a new thread
pthread_create OpenBSD create a new thread
rfork_thread FreeBSD create a rfork-based process thread
pthread_setspecific Tru64 Sets the thread-specific data value associated with the specified key for the current thread
pthread_cancel Tru64 Allows a thread to request a thread to terminate execution
pthread_join Tru64 Causes the calling thread to wait for the termination of the specified thread
execppp IRIX Start a PPP call.
startnfs IRIX start nfs deamon.
newsess IRIX start a new array session
dbxhang IRIX start a process without really starting it
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service