From 6e3962716f014270ce7289d8449b40451b59a99d Mon Sep 17 00:00:00 2001 From: "Michael B. McLaughlin" Date: Tue, 11 Jul 2017 09:31:33 -0400 Subject: [PATCH 1/2] In tab:async.reqmts.executor.requirements, split post and defer into two table entries and change the text explaining the hoped for difference from a non-normative note into a normative "should". --- src/async.tex | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/async.tex b/src/async.tex index 22599ff..c6967ab 100644 --- a/src/async.tex +++ b/src/async.tex @@ -280,11 +280,15 @@ \effects Creates an object \tcode{f1} initialized with \tcode{\placeholdernc{DECAY_COPY}(forward(f))} (\CppXref{thread.decaycopy}) in the current thread of execution. Calls \tcode{f1()} at most once. The executor may block forward progress of the caller until \tcode{f1()} finishes execution. Executor implementations should use the supplied allocator to allocate any memory required to store the function object. Prior to invoking the function object, the executor shall deallocate any memory allocated. \begin{note} Executors defined in this Technical Specification always use the supplied allocator unless otherwise specified. \end{note} \br \sync The invocation of \tcode{dispatch} synchronizes with (\CppXref{intro.multithread}) the invocation of \tcode{f1}. \\ \rowsep -\tcode{x1.post(std::move(f),~a)}\br +\tcode{x1.post(std::move(f),~a)} & + & +\effects Creates an object \tcode{f1} initialized with \tcode{\placeholdernc{DECAY_COPY}(forward(f))} in the current thread of execution. Calls \tcode{f1()} at most once. The executor shall not block forward progress of the caller pending completion of \tcode{f1()}. The caller should not block the first step of \tcode{f1}'s progress. Executor implementations should use the supplied allocator to allocate any memory required to store the function object. Prior to invoking the function object, the executor shall deallocate any memory allocated. \begin{note} Executors defined in this Technical Specification always use the supplied allocator unless otherwise specified. \end{note}\br +\sync The invocation of \tcode{post} synchronizes with (\CppXref{intro.multithread}) the invocation of \tcode{f1}. \\ \rowsep + \tcode{x1.defer(std::move(f),~a)} & & -\effects Creates an object \tcode{f1} initialized with \tcode{\placeholdernc{DECAY_COPY}(forward(f))} in the current thread of execution. Calls \tcode{f1()} at most once. The executor shall not block forward progress of the caller pending completion of \tcode{f1()}. Executor implementations should use the supplied allocator to allocate any memory required to store the function object. Prior to invoking the function object, the executor shall deallocate any memory allocated. \begin{note} Executors defined in this Technical Specification always use the supplied allocator unless otherwise specified. \end{note}\br -\sync The invocation of \tcode{post} or \tcode{defer} synchronizes with (\CppXref{intro.multithread}) the invocation of \tcode{f1}. \begin{note} Although the requirements placed on \tcode{defer} are identical to \tcode{post}, the use of \tcode{post} conveys a preference that the caller does not block the first step of \tcode{f1}'s progress, whereas \tcode{defer} conveys a preference that the caller does block the first step of \tcode{f1}. One use of \tcode{defer} is to convey the intention of the caller that \tcode{f1} is a continuation of the current call context. The executor may use this information to optimize or otherwise adjust the way in which \tcode{f1} is invoked. \end{note} \\ +\effects Creates an object \tcode{f1} initialized with \tcode{\placeholdernc{DECAY_COPY}(forward(f))} in the current thread of execution. Calls \tcode{f1()} at most once. The executor shall not block forward progress of the caller pending completion of \tcode{f1()}. The caller should not block the first step of \tcode{f1}'s progress. \begin{note} One use of \tcode{defer} is to convey the intention of the caller that \tcode{f1} is a continuation of the current call context. The executor may use this information to optimize or otherwise adjust the way in which \tcode{f1} is invoked. \end{note} Executor implementations should use the supplied allocator to allocate any memory required to store the function object. Prior to invoking the function object, the executor shall deallocate any memory allocated. \begin{note} Executors defined in this Technical Specification always use the supplied allocator unless otherwise specified. \end{note}\br +\sync The invocation of \tcode{defer} synchronizes with (\CppXref{intro.multithread}) the invocation of \tcode{f1}. \\ \end{libreqtab3} From ff2c546b4ce697f879bc771692a57a475f4a732f Mon Sep 17 00:00:00 2001 From: "Michael B. McLaughlin" Date: Tue, 11 Jul 2017 13:27:27 -0400 Subject: [PATCH 2/2] Reworded the normative text explaining the difference between post and defer. --- src/async.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/async.tex b/src/async.tex index c6967ab..aefdaa5 100644 --- a/src/async.tex +++ b/src/async.tex @@ -282,12 +282,12 @@ \tcode{x1.post(std::move(f),~a)} & & -\effects Creates an object \tcode{f1} initialized with \tcode{\placeholdernc{DECAY_COPY}(forward(f))} in the current thread of execution. Calls \tcode{f1()} at most once. The executor shall not block forward progress of the caller pending completion of \tcode{f1()}. The caller should not block the first step of \tcode{f1}'s progress. Executor implementations should use the supplied allocator to allocate any memory required to store the function object. Prior to invoking the function object, the executor shall deallocate any memory allocated. \begin{note} Executors defined in this Technical Specification always use the supplied allocator unless otherwise specified. \end{note}\br +\effects Creates an object \tcode{f1} initialized with \tcode{\placeholdernc{DECAY_COPY}(forward(f))} in the current thread of execution. Calls \tcode{f1()} at most once. The executor shall not block forward progress of the caller pending completion of \tcode{f1()}. The executor may begin \tcode{f1}'s progress. Executor implementations should use the supplied allocator to allocate any memory required to store the function object. Prior to invoking the function object, the executor shall deallocate any memory allocated. \begin{note} Executors defined in this Technical Specification always use the supplied allocator unless otherwise specified. \end{note}\br \sync The invocation of \tcode{post} synchronizes with (\CppXref{intro.multithread}) the invocation of \tcode{f1}. \\ \rowsep \tcode{x1.defer(std::move(f),~a)} & & -\effects Creates an object \tcode{f1} initialized with \tcode{\placeholdernc{DECAY_COPY}(forward(f))} in the current thread of execution. Calls \tcode{f1()} at most once. The executor shall not block forward progress of the caller pending completion of \tcode{f1()}. The caller should not block the first step of \tcode{f1}'s progress. \begin{note} One use of \tcode{defer} is to convey the intention of the caller that \tcode{f1} is a continuation of the current call context. The executor may use this information to optimize or otherwise adjust the way in which \tcode{f1} is invoked. \end{note} Executor implementations should use the supplied allocator to allocate any memory required to store the function object. Prior to invoking the function object, the executor shall deallocate any memory allocated. \begin{note} Executors defined in this Technical Specification always use the supplied allocator unless otherwise specified. \end{note}\br +\effects Creates an object \tcode{f1} initialized with \tcode{\placeholdernc{DECAY_COPY}(forward(f))} in the current thread of execution. Calls \tcode{f1()} at most once. The executor shall not block forward progress of the caller pending completion of \tcode{f1()}. The executor should not begin \tcode{f1}'s progress. \begin{note} One use of \tcode{defer} is to convey the intention of the caller that \tcode{f1} is a continuation of the current call context. The executor may use this information to optimize or otherwise adjust the way in which \tcode{f1} is invoked. \end{note} Executor implementations should use the supplied allocator to allocate any memory required to store the function object. Prior to invoking the function object, the executor shall deallocate any memory allocated. \begin{note} Executors defined in this Technical Specification always use the supplied allocator unless otherwise specified. \end{note}\br \sync The invocation of \tcode{defer} synchronizes with (\CppXref{intro.multithread}) the invocation of \tcode{f1}. \\ \end{libreqtab3}