xtd 0.2.0
Loading...
Searching...
No Matches

Definition

Contains tasks definitions.

Classes

class  xtd::threading::tasks::itask
 Represents an interface for an asynchronous operation. More...
 
class  xtd::threading::tasks::parallel
 Provides support for creating and scheduling Task objects. More...
 
class  xtd::threading::tasks::task< void >
 Represents an asynchronous operation. More...
 
class  xtd::threading::tasks::task_canceled_exception
 Represents an exception used to communicate task cancellation. More...
 
class  xtd::threading::tasks::task_factory
 Provides support for creating and scheduling Task objects. More...
 
class  xtd::threading::tasks::task< result_t >
 Represents an asynchronous operation. More...
 

Enumerations

enum class  xtd::threading::tasks::task_creation_options {
  xtd::threading::tasks::task_creation_options::none ,
  xtd::threading::tasks::task_creation_options::prefer_fairness ,
  xtd::threading::tasks::task_creation_options::long_running ,
  xtd::threading::tasks::task_creation_options::attached_to_parent ,
  xtd::threading::tasks::task_creation_options::deny_child_attach ,
  xtd::threading::tasks::task_creation_options::hide_scheduler ,
  xtd::threading::tasks::task_creation_options::run_continuations_asynchronously
}
 Specifies flags that control optional behavior for the creation and execution of tasks. This enumeration supports a bitwise combination of its member values. More...
 
enum class  xtd::threading::tasks::task_status {
  xtd::threading::tasks::task_status::created ,
  xtd::threading::tasks::task_status::waiting_for_activation ,
  xtd::threading::tasks::task_status::waiting_to_run ,
  xtd::threading::tasks::task_status::running ,
  xtd::threading::tasks::task_status::waiting_for_children_to_complete ,
  xtd::threading::tasks::task_status::ran_to_completion ,
  xtd::threading::tasks::task_status::canceled ,
  xtd::threading::tasks::task_status::faulted
}
 Represents the current stage in the lifecycle of a xtd::threading::tasks::task. More...
 

Enumeration Type Documentation

◆ task_creation_options

#include <xtd.core/include/xtd/threading/tasks/task_creation_options.hpp>

Specifies flags that control optional behavior for the creation and execution of tasks. This enumeration supports a bitwise combination of its member values.

Namespace
xtd::threading::tasks
Header
#include <xtd/threading/tasks/task_creation_options>
Library
xtd.core
Enumerator
none 

Specifies that the default behavior should be used.

prefer_fairness 

A hint to a xtd::threading::tasks::task_scheduler to schedule a task in as fair a manner as possible, meaning that tasks scheduled sooner will be more likely to be run sooner, and tasks scheduled later will be more likely to be run later.

long_running 

Specifies that a task will be a long-running, coarse-grained operation involving fewer, larger components than fine-grained systems. It provides a hint to the xtd::threading::tasks::task_scheduler that oversubscription may be warranted. Oversubscription lets you create more threads than the available number of hardware threads. It also provides a hint to the task scheduler that an additional thread might be required for the task so that it does not block the forward progress of other threads or work items on the local thread-pool queue.

attached_to_parent 

Specifies that a task is attached to a parent in the task hierarchy. By default, a child task (that is, an inner task created by an outer task) executes independently of its parent. You can use the AttachedToParent option so that the parent and child tasks are synchronized.
Note that if a parent task is configured with the DenyChildAttach option, the AttachedToParent option in the child task has no effect, and the child task will execute as a detached child task.

deny_child_attach 

Specifies that any child task that attempts to execute as an attached child task (that is, it is created with the AttachedToParent option) will not be able to attach to the parent task and will execute instead as a detached child task. For more information, see Attached and Detached Child Tasks.

hide_scheduler 

Prevents the ambient scheduler from being seen as the current scheduler in the created task. This means that operations like StartNew or ContinueWith that are performed in the created task will see Default as the current scheduler.

run_continuations_asynchronously 

Forces continuations added to the current task to be executed asynchronously.

◆ task_status

#include <xtd.core/include/xtd/threading/tasks/task_status.hpp>

Represents the current stage in the lifecycle of a xtd::threading::tasks::task.

Namespace
xtd::threading::tasks
Header
#include <xtd/threading/tasks/task_status>
Library
xtd.core
Enumerator
created 

The task has been initialized but has not yet been scheduled.

waiting_for_activation 

The task is waiting to be activated and scheduled internally by the Switch infrastructure.

waiting_to_run 

The task has been scheduled for execution but has not yet begun executing.

running 

The task is running but has not yet completed.

waiting_for_children_to_complete 

The task has finished executing and is implicitly waiting for attached child tasks to complete.

ran_to_completion 

The task completed execution successfully.

canceled 

The task acknowledged cancellation by throwing an OperationCanceledException with its own CancellationToken while the token was in signaled state, or the task's CancellationToken was already signaled before the task started executing. For more information, see Task Cancellation.

faulted 

The task completed due to an unhandled exception.