2 .\" This file and its contents are supplied under the terms of the
3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 .\" You may only use this file in accordance with the terms of version
7 .\" A full copy of the text of the CDDL should have accompanied this
8 .\" source. A copy of the CDDL is also available via the Internet at
9 .\" http://www.illumos.org/license/CDDL.
12 .\" Copyright 2016 Joyent, Inc.
22 .Vt "typedef int (*thrd_start_t)(void *);"
26 .Fa "thrd_start_t func"
32 function creates a new thread of execution inside of the current
33 process and stores its identifier in
35 Each thread operates concurrently within the process.
37 When a thread is created, it begins its execution at the function
41 A created thread has access to all global data within a process;
42 however, it has its own private stack.
43 Currently 32-bit processes have a default stack of 1 megabyte, while 64-bit
44 systems have a default stack size of 2 megabytes.
45 In addition, newly created threads inherit the signal mask of the thread which
46 created them; however, they do not inherit any pending signals.
48 Once created, a thread will continue to execute until either, it returns
49 from its initial function, the thread explicitly calls
51 or the process itself terminates, such as with a call to
53 When the initial function returns, it behaves as though a call to
55 was made, and, if the thread has not been detached with a call to
57 the exit status remains available and the corresponding thread ID will
58 not be reused until a process calls
60 This is similar to how a parent must call
62 to clean up a child process that has terminated.
64 For a richer interface interface with more control over aspects of the
65 newly created thread, such as stack size, stack placement, and the like,
69 .Xr pthread_create 3C .
71 Upon successful completion, the
75 If insufficient memory was available, then
80 is returned, indicating that a non-memory related error.
81 .Sh INTERFACE STABILITY
86 .Xr pthread_create 3C ,