Skip to content

Commit

Permalink
Update task_scheduler_handle_cls.rst
Browse files Browse the repository at this point in the history
Fix formatting
  • Loading branch information
alexey-katranov committed Sep 2, 2021
1 parent 83e1230 commit d9bf6cc
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 52 deletions.
64 changes: 64 additions & 0 deletions source/elements/oneTBB/source/deprecated/task_arena_attach_tag.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
.. SPDX-FileCopyrightText: 2019-2020 Intel Corporation
..
.. SPDX-License-Identifier: CC-BY-4.0
==================
task_arena::attach
==================
**[deprecated.task_arena_attach_tag]**

.. caution::

Deprecated in oneTBB Specification 1.1

A set of methods for constructing a task_arena with attach.

.. code:: cpp
// Defined in header <tbb/task_arena.h>
namespace tbb {
class task_arena {
public:
// ...
struct attach {};
explicit task_arena(task_arena::attach);
void initialize(task_arena::attach);
// ...
};
} // namespace tbb
Member types and constants
--------------------------

.. cpp:struct:: attach

A tag for constructing a task_arena with attach.

Member functions
----------------

.. cpp:function:: explicit task_arena(task_arena::attach)

Creates an instance of ``task_arena`` that is connected to the internal task arena representation currently used by the calling thread.
If no such arena exists yet, creates a ``task_arena`` with default parameters.

.. note::

Unlike other constructors, this one automatically initializes
the new ``task_arena`` when connecting to an already existing arena.


.. cpp:function:: void initialize(task_arena::attach)

If an internal task arena representation currently used by the calling thread, the method ignores arena
parameters and connects ``task_arena`` to that internal task arena representation.
The method has no effect when called for an already initialized ``task_arena``.

See also:

* :doc:`attach <../task_scheduler/attach_tag_type>`
6 changes: 6 additions & 0 deletions source/elements/oneTBB/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ oneAPI Threading Building Blocks Specification
mutual_exclusion.rst
timing.rst
info_namespace.rst

.. toctree::
:maxdepth: 2
:caption: oneTBB Deprecated Interfaces:

deprecated/task_arena_attach_tag.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ thread until the completion of all worker threads that were implicitly created b
namespace oneapi {
namespace tbb {
using attach = /* unspecified */
class task_scheduler_handle {
public:
task_scheduler_handle() = default;
Expand Down Expand Up @@ -49,7 +47,7 @@ Member Functions

.. cpp:function:: task_scheduler_handle()

**Effects**: Creates an instance of the ``task_scheduler_handle`` class that does not contain any reference to the task scheduler.
**Effects**: Creates an empty instance of the ``task_scheduler_handle`` class that does not contain any reference to the task scheduler.

-------------------------------------------------------

Expand All @@ -63,7 +61,7 @@ Member Functions
.. cpp:function:: ~task_scheduler_handle()

**Effects**: Destroys an instance of the ``task_scheduler_handle`` class.
Releases a reference to the task scheduler and deactivates an instance of the ``task_scheduler_handle`` class.
If not empty, releases a reference to the task scheduler and deactivates an instance of the ``task_scheduler_handle`` class.

-------------------------------------------------------

Expand All @@ -75,31 +73,30 @@ Member Functions

.. cpp:function:: task_scheduler_handle& operator=(task_scheduler_handle&& other) noexcept

**Effects**: Releases a reference to the task scheduler referenced by ``this``. Adds a reference to the task scheduler referenced by ``other``.
**Effects**: If not empty, releases a reference to the task scheduler referenced by ``this``. Adds a reference to the task scheduler referenced by ``other``.
In turn, ``other`` releases its reference to the task scheduler.

**Returns**: A reference to ``*this``.
**Returns**: A reference to ``*this``.

-------------------------------------------------------

.. cpp:function:: explicit operator bool() const noexcept

**Returns**: ``true`` if ``this`` references any task scheduler; ``false`` otherwise.
**Returns**: ``true`` if ``this`` is not empty and references any task scheduler; ``false`` otherwise.

-------------------------------------------------------

.. cpp:function:: void release()

**Effects**: Releases a reference to the task scheduler and deactivates an instance of the ``task_scheduler_handle``
class. Non-blocking method.
**Effects**: If not empty, releases a reference to the task scheduler and deactivates an instance of the ``task_scheduler_handle``
class; no effect otherwise. Non-blocking method.

Non-member Functions
--------------------

.. cpp:function:: void finalize(task_scheduler_handle& handle)

**Effects**: Blocks the program execution until all worker threads have been completed. Throws the ``oneapi::tbb::unsafe_wait``
exception if it is not safe to wait for the completion of the worker threads.
**Effects**: If ``handle`` is not empty, blocks the program execution until all worker threads have been completed; no effect otherwise.
Throws the ``oneapi::tbb::unsafe_wait`` exception if it is not safe to wait for the completion of the worker threads.

The following conditions should be met for finalization to succeed:

Expand All @@ -124,8 +121,9 @@ If calls are performed simultaneously, more than one call might succeed.

.. cpp:function:: bool finalize(task_scheduler_handle& handle, const std::nothrow_t&) noexcept

**Effects**: Blocks the program execution until all worker threads have been completed. Same as above, but returns ``true`` if all worker
threads have been completed successfully, or ``false`` if it is not safe to wait for the completion of the worker threads.
**Effects**: If ``handle`` is not empty, blocks the program execution until all worker threads have been completed; no effect otherwise.
Same as above, but returns ``true`` if all worker threads have been completed successfully, or ``false`` if it is not safe to wait for
the completion of the worker threads.

Examples
--------
Expand Down Expand Up @@ -155,4 +153,4 @@ Examples
See also:

* :doc:`attach <../attach_tag_type>`
* :doc:`attach <../attach_tag_type>`
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ A class that represents an explicit, user-managed task scheduler arena.
namespace tbb {
using attach = /* unspecified */
class task_arena {
public:
static const int automatic = /* unspecified */;
Expand All @@ -26,7 +24,7 @@ A class that represents an explicit, user-managed task scheduler arena.
normal = /* unspecified */,
high = /* unspecified */
};
struct attach {}; /* Deprecated (compatibility with oneTBB Specification 1.0), use oneapi::tbb::attach */
struct constraints {
numa_node_id numa_node;
int max_concurrency;
Expand All @@ -41,7 +39,6 @@ A class that represents an explicit, user-managed task scheduler arena.
priority a_priority = priority::normal);
task_arena(const task_arena &s);
explicit task_arena(oneapi::tbb::attach);
explicit task_arena(task_arena::attach); /* Deprecated (compatibility with oneTBB Specification 1.0), use oneapi::tbb::attach version */
~task_arena();
void initialize();
Expand All @@ -50,7 +47,6 @@ A class that represents an explicit, user-managed task scheduler arena.
void initialize(constraints a_constraints, unsigned reserved_for_masters = 1,
priority a_priority = priority::normal);
void initialize(oneapi::tbb::attach);
void initialize(task_arena::attach); /* Deprecated (compatibility with oneTBB Specification 1.0), use oneapi::tbb::attach version */
void terminate();
Expand Down Expand Up @@ -109,14 +105,6 @@ Member types and constants
When passed to a constructor or the ``initialize`` method, the initialized ``task_arena``
has a raised priority.

.. cpp:struct:: attach

A tag for constructing a ``task_arena`` with attach.

.. caution::

``struct attach`` is deprecated (compatibility with oneTBB Specification 1.0), use oneapi::tbb::attach

.. cpp:struct:: constraints

Represents limitations applied to threads within ``task_arena``.
Expand Down Expand Up @@ -177,20 +165,6 @@ Member functions
Unlike other constructors, this one automatically initializes
the new ``task_arena`` when connecting to an already existing arena.

.. cpp:function:: explicit task_arena(task_arena::attach)

Creates an instance of ``task_arena`` that is connected to the internal task arena representation currently used by the calling thread.
If no such arena exists yet, creates a ``task_arena`` with default parameters.

.. note::

Unlike other constructors, this one automatically initializes
the new ``task_arena`` when connecting to an already existing arena.

.. caution::

``struct attach`` is deprecated (compatibility with oneTBB Specification 1.0), use oneapi::tbb::attach version

.. cpp:function:: ~task_arena()

Destroys the ``task_arena`` instance, but the destruction may not be synchronized with any task execution inside this ``task_arena``.
Expand Down Expand Up @@ -219,16 +193,6 @@ Member functions
parameters and connects ``task_arena`` to that internal task arena representation.
The method has no effect when called for an already initialized ``task_arena``.

.. cpp:function:: void initialize(task_arena::attach)

If an internal task arena representation currently used by the calling thread, the method ignores arena
parameters and connects ``task_arena`` to that internal task arena representation.
The method has no effect when called for an already initialized ``task_arena``.

.. caution::

``struct attach`` is deprecated (compatibility with oneTBB Specification 1.0), use oneapi::tbb::attach version

.. cpp:function:: void terminate()

Removes the reference to the internal task arena representation without destroying the
Expand Down

0 comments on commit d9bf6cc

Please sign in to comment.