Skip to content

Commit

Permalink
Resolution of issue #1
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsc committed Feb 22, 2016
1 parent 9f03ee1 commit da59804
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 16 deletions.
28 changes: 20 additions & 8 deletions definitions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
For the purposes of this document,
the following terms and definitions apply.

\begin{comment}
\definition{thread of execution}{
flow of control within a program,
including a top-level statement or expression,
Expand All @@ -24,15 +25,23 @@
There is typically significant overhead involved
in creating a new OS thread.
\end{note}
\end{comment}

\definition{thread}{
thread of execution, or OS thread
either the main thread of the program,
or a thread created by the program using
\tcode{thrd_create},
or a worker thread
}

\begin{note}
This word, when used without qualification, is ambiguous.
\end{note}
\definition{worker thread}{
thread created by the implementation
(as if by
\tcode{thrd_create})
for the purpose of executing tasks in parallel
}

\begin{comment}
\definition{execution agent}{
entity, such as an OS thread,
that may execute a thread of execution
Expand All @@ -41,35 +50,38 @@
Adapted from the C++ standard.
}
}
\end{comment}

\definition{task}{
thread of execution within a program
subsection of the flow of control
within a program
that can be correctly executed asynchronously
with respect to
independent threads of execution from}
other, independent tasks in
the program
}

\definition{concurrent program}{
program that uses multiple concurrent interacting threads of execution,
each with its own progress requirements
}

\begin{example}
A program that has separate server and client threads
is a concurrent program.
\end{example}
}

\definition{parallel program}{
program whose computation
involves independent tasks,
which may be distributed across multiple computational units
to be executed simultaneously
}

\begin{note}
If sufficient computational resources are available,
a parallel program may execute significantly faster than
an otherwise equivalent serial program.
\end{note}
}

\end{definitions}
7 changes: 4 additions & 3 deletions loopparameter.tex
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@
\pfx{set_num_threads}
macro sets to
\tcode{num_threads}
the recommended number of execution agents to be used
to execute the iterations of a parallel loop
the recommended number of iterations
to be executed concurrently
in a parallel loop
associated with the object pointed to by
\tcode{hints}.

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

\sclause{The \tcode{schedule_kind} parameter}
\ssclause*{Synopsis}
Expand Down
20 changes: 15 additions & 5 deletions tasks.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

\pnum
A task is permitted to execute
in either the invoking OS thread
or an OS thread implicitly created by the implementation
to support task execution.
Independent tasks executing in the same OS thread
either in the invoking thread
or in a worker thread implicitly created by the implementation.
Independent tasks executing in the same thread
are indeterminately sequenced with respect to one another.
Independent tasks executing in different OS threads
Independent tasks executing in different threads
are unsequenced with respect to one another.

\pnum
Expand All @@ -19,3 +18,14 @@
with the completion of the associated task block,
or with the next execution of a sync statement
within the associated task block.

\pnum
It is unspecified whether a worker thread is reused
for multiple tasks
during the execution of a program.
The lifetimes (creation and termination points)
of worker threads are unspecified.
An attempt by the program
to terminate, detach or join with
a worker thread
results in undefined behavior.

0 comments on commit da59804

Please sign in to comment.