B.2 Thread Creation, Destruction, and Control
Keywords: perfbook_html

#
B.2 Thread Creation, Destruction, and Control

This API focuses on ``threads'', which are a locus of control.B.1Each such thread has an identifier of type thread_id_t, and no two threads running at a given time will have the same identifier. Threads share everything except for per-thread local state,B.2which includes program counter and stack.

The thread API is shown in Figure , and members are described in the following sections.

Figure: Thread API

Subsections

- B.2.1 create_thread()
- B.2.2 smp_thread_id()
- B.2.3 for_each_thread()
- B.2.4 for_each_running_thread()
- B.2.5 wait_thread()
- B.2.6 wait_all_threads()
- B.2.7 Example Usage