tmp/tmp1mg46n_w/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### General <a id="intro.multithread.general">[[intro.multithread.general]]</a>
|
| 2 |
+
|
| 3 |
+
A *thread of execution* (also known as a *thread*) is a single flow of
|
| 4 |
+
control within a program, including the initial invocation of a specific
|
| 5 |
+
top-level function, and recursively including every function invocation
|
| 6 |
+
subsequently executed by the thread.
|
| 7 |
+
|
| 8 |
+
[*Note 1*: When one thread creates another, the initial call to the
|
| 9 |
+
top-level function of the new thread is executed by the new thread, not
|
| 10 |
+
by the creating thread. — *end note*]
|
| 11 |
+
|
| 12 |
+
Every thread in a program can potentially access every object and
|
| 13 |
+
function in a program.[^24]
|
| 14 |
+
|
| 15 |
+
Under a hosted implementation, a C++ program can have more than one
|
| 16 |
+
thread running concurrently. The execution of each thread proceeds as
|
| 17 |
+
defined by the remainder of this document. The execution of the entire
|
| 18 |
+
program consists of an execution of all of its threads.
|
| 19 |
+
|
| 20 |
+
[*Note 2*: Usually the execution can be viewed as an interleaving of
|
| 21 |
+
all its threads. However, some kinds of atomic operations, for example,
|
| 22 |
+
allow executions inconsistent with a simple interleaving, as described
|
| 23 |
+
below. — *end note*]
|
| 24 |
+
|
| 25 |
+
Under a freestanding implementation, it is *implementation-defined*
|
| 26 |
+
whether a program can have more than one thread of execution.
|
| 27 |
+
|
| 28 |
+
For a signal handler that is not executed as a result of a call to the
|
| 29 |
+
`std::raise` function, it is unspecified which thread of execution
|
| 30 |
+
contains the signal handler invocation.
|
| 31 |
+
|