Skip to content

Commit da59804

Browse files
committed
Resolution of issue #1
1 parent 9f03ee1 commit da59804

File tree

3 files changed

+39
-16
lines changed

3 files changed

+39
-16
lines changed

definitions.tex

+20-8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
For the purposes of this document,
55
the following terms and definitions apply.
66

7+
\begin{comment}
78
\definition{thread of execution}{
89
flow of control within a program,
910
including a top-level statement or expression,
@@ -24,15 +25,23 @@
2425
There is typically significant overhead involved
2526
in creating a new OS thread.
2627
\end{note}
28+
\end{comment}
2729

2830
\definition{thread}{
29-
thread of execution, or OS thread
31+
either the main thread of the program,
32+
or a thread created by the program using
33+
\tcode{thrd_create},
34+
or a worker thread
3035
}
3136

32-
\begin{note}
33-
This word, when used without qualification, is ambiguous.
34-
\end{note}
37+
\definition{worker thread}{
38+
thread created by the implementation
39+
(as if by
40+
\tcode{thrd_create})
41+
for the purpose of executing tasks in parallel
42+
}
3543

44+
\begin{comment}
3645
\definition{execution agent}{
3746
entity, such as an OS thread,
3847
that may execute a thread of execution
@@ -41,35 +50,38 @@
4150
Adapted from the C++ standard.
4251
}
4352
}
53+
\end{comment}
4454

4555
\definition{task}{
46-
thread of execution within a program
56+
subsection of the flow of control
57+
within a program
4758
that can be correctly executed asynchronously
4859
with respect to
49-
independent threads of execution from}
60+
other, independent tasks in
5061
the program
62+
}
5163

5264
\definition{concurrent program}{
5365
program that uses multiple concurrent interacting threads of execution,
5466
each with its own progress requirements
55-
}
5667

5768
\begin{example}
5869
A program that has separate server and client threads
5970
is a concurrent program.
6071
\end{example}
72+
}
6173

6274
\definition{parallel program}{
6375
program whose computation
6476
involves independent tasks,
6577
which may be distributed across multiple computational units
6678
to be executed simultaneously
67-
}
6879

6980
\begin{note}
7081
If sufficient computational resources are available,
7182
a parallel program may execute significantly faster than
7283
an otherwise equivalent serial program.
7384
\end{note}
85+
}
7486

7587
\end{definitions}

loopparameter.tex

+4-3
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,9 @@
117117
\pfx{set_num_threads}
118118
macro sets to
119119
\tcode{num_threads}
120-
the recommended number of execution agents to be used
121-
to execute the iterations of a parallel loop
120+
the recommended number of iterations
121+
to be executed concurrently
122+
in a parallel loop
122123
associated with the object pointed to by
123124
\tcode{hints}.
124125

@@ -140,7 +141,7 @@
140141
of a parallel loop associated with the object pointed to by
141142
\tcode{hints}
142143
to be grouped together to be executed sequentially
143-
in a single thread of execution.
144+
as a single task.
144145

145146
\sclause{The \tcode{schedule_kind} parameter}
146147
\ssclause*{Synopsis}

tasks.tex

+15-5
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
\pnum
44
A task is permitted to execute
5-
in either the invoking OS thread
6-
or an OS thread implicitly created by the implementation
7-
to support task execution.
8-
Independent tasks executing in the same OS thread
5+
either in the invoking thread
6+
or in a worker thread implicitly created by the implementation.
7+
Independent tasks executing in the same thread
98
are indeterminately sequenced with respect to one another.
10-
Independent tasks executing in different OS threads
9+
Independent tasks executing in different threads
1110
are unsequenced with respect to one another.
1211

1312
\pnum
@@ -19,3 +18,14 @@
1918
with the completion of the associated task block,
2019
or with the next execution of a sync statement
2120
within the associated task block.
21+
22+
\pnum
23+
It is unspecified whether a worker thread is reused
24+
for multiple tasks
25+
during the execution of a program.
26+
The lifetimes (creation and termination points)
27+
of worker threads are unspecified.
28+
An attempt by the program
29+
to terminate, detach or join with
30+
a worker thread
31+
results in undefined behavior.

0 commit comments

Comments
 (0)