18 #ifndef _PPLINTERFACE_H
19 #define _PPLINTERFACE_H
37 struct __declspec(novtable) scheduler_interface
39 virtual void schedule(
TaskProc_t,
void* ) = 0;
75 scheduler_interface *
get()
const
83 operator bool()
const {
return get() !=
nullptr; }
237 template<
typename _T>
240 _T _Result = _Comparand;
241 _Target.compare_exchange_strong(_Result, _Exchange);
245 template<
typename _T>
248 return _Target.exchange(_Value);
251 template<
typename _T>
254 return _Target.fetch_add(1) + 1;
257 template<
typename _T>
260 return _Target.fetch_sub(1) - 1;
263 template<
typename _T>
266 return _Target.fetch_add(_Value) +
_Value;
271 #endif // _PPLINTERFACE_H
_T atomic_exchange(std::atomic< _T > &_Target, _T _Value)
Definition: pplinterface.h:246
scheduler_ptr(std::shared_ptr< scheduler_interface > _Scheduler)
Creates a scheduler pointer from shared_ptr to scheduler
Definition: pplinterface.h:52
This class describes an exception thrown when an invalid operation is performed that is not more accu...
Definition: pplinterface.h:132
scheduler_ptr(_In_opt_ scheduler_interface *_PScheduler)
Creates a scheduler pointer from raw pointer to scheduler
Definition: pplinterface.h:60
_Interruption_exception() _NOEXCEPT
Definition: pplinterface.h:201
_T atomic_compare_exchange(std::atomic< _T > &_Target, _T _Exchange, _T _Comparand)
Definition: pplinterface.h:238
scheduler_interface * _M_scheduler
Definition: pplinterface.h:88
Definition: pplinterface.h:228
std::atomic< size_t > atomic_size_t
Definition: pplinterface.h:235
This class describes an exception thrown by the PPL tasks layer in order to force the current task to...
Definition: pplinterface.h:163
#define _NOEXCEPT
Definition: yvals.h:25
scheduler_interface * operator->() const
Behave like a pointer
Definition: pplinterface.h:67
The Concurrency namespace provides classes and functions that provide access to the Concurrency Runti...
Definition: agents.h:43
The tasks queued to the task_group object have not completed. Note that this value is not presently r...
Definition: pplinterface.h:109
_T atomic_decrement(std::atomic< _T > &_Target)
Definition: pplinterface.h:258
invalid_operation() _NOEXCEPT
Constructs an invalid_operation object.
Definition: pplinterface.h:150
task_canceled(_In_z_ const char *_Message) _NOEXCEPT
Constructs a task_canceled object.
Definition: pplinterface.h:173
Definition: pplinterface.h:224
_Interruption_exception(const char *_Message) _NOEXCEPT
Definition: pplinterface.h:197
Definition: pplinterface.h:226
std::shared_ptr< scheduler_interface > _M_sharedScheduler
Definition: pplinterface.h:87
#define _In_z_
Definition: sal.h:310
_TaskInliningMode
The enum defines inlining scheduling policy for ppltasks. Scheduling a chore or a functor with _TaskI...
Definition: pplinterface.h:221
#define _In_opt_
Definition: sal.h:306
#define bool
Definition: stdbool.h:15
The tasks queued to the task_group or structured_task_group object completed successfully.
Definition: pplinterface.h:115
The task_group or structured_task_group object was canceled. One or more tasks may not have executed...
Definition: pplinterface.h:121
_T atomic_add(std::atomic< _T > &_Target, _T _Value)
Definition: pplinterface.h:264
const void * _Target(const _XSTD2 type_info &_Info) const _NOEXCEPT
Definition: functional:413
Represents a pointer to a scheduler. This class exists to allow the the specification of a shared lif...
Definition: pplinterface.h:47
void(__cdecl * TaskProc_t)(void *)
An elementary abstraction for a task, defined as void (__cdecl * TaskProc_t)(void *)...
Definition: pplinterface.h:32
_T atomic_increment(std::atomic< _T > &_Target)
Definition: pplinterface.h:252
task_group_status
Describes the execution status of a task_group or structured_task_group object. A value of this type ...
Definition: pplinterface.h:102
task_canceled() _NOEXCEPT
Constructs a task_canceled object.
Definition: pplinterface.h:181
Definition: pplinterface.h:194
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
std::atomic< long > atomic_long
Atomics
Definition: pplinterface.h:234
invalid_operation(_In_z_ const char *_Message) _NOEXCEPT
Constructs an invalid_operation object.
Definition: pplinterface.h:142
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *unexpected_handler)()
_In_ int _Value
Definition: setjmp.h:173