LLFIO
v2.00
|
An individual item of work within the work group. More...
#include "dynamic_thread_pool_group.hpp"
Public Member Functions | |
dynamic_thread_pool_group * | parent () const noexcept |
Returns the parent work group between successful submission and just before group_complete() . | |
virtual intptr_t | next (deadline &d) noexcept=0 |
virtual result< void > | operator() (intptr_t work) noexcept=0 |
virtual void | group_complete (const result< void > &cancelled) noexcept |
Protected Member Functions | |
constexpr bool | _has_timer_set_relative () const noexcept |
constexpr bool | _has_timer_set_absolute () const noexcept |
constexpr bool | _has_timer_set () const noexcept |
work_item (const work_item &o)=delete | |
work_item (work_item &&o) noexcept | |
work_item & | operator= (const work_item &)=delete |
work_item & | operator= (work_item &&)=delete |
Friends | |
class | dynamic_thread_pool_group_impl |
An individual item of work within the work group.
|
inlinevirtualnoexcept |
Invoked by the i/o thread pool when all work in this thread pool group is complete.
cancelled
indicates if this is an abnormal completion. If its error compares equal to errc::operation_cancelled
, then stop()
was called.
Just before this is called for all work items submitted, the group becomes reset to fresh, and parent()
becomes null. You can resubmit this work item, but do not submit other work items until their group_complete()
has been invoked.
Note that this function is called from multiple kernel threads.
dynamic_thread_pool_group::current_work_item()
may have any value during this call.
|
pure virtualnoexcept |
Invoked by the i/o thread pool to determine if this work item has more work to do.
d | Optional delay before the next item of work ought to be executed (return != 0), or next() ought to be called again to determine the next item (return == 0). On entry d is set to no delay, so if you don't modify it, the next item of work occurs as soon as possible. |
Note that this function is called from multiple kernel threads. You must NOT do any significant work in this function. In particular do NOT call any dynamic thread pool group function, as you will experience deadlock.
dynamic_thread_pool_group::current_work_item()
may have any value during this call.
|
pure virtualnoexcept |
Invoked by the i/o thread pool to perform the next item of work.
work | The value returned by next() . |
Note that this function is called from multiple kernel threads, and may not be the kernel thread from which next()
was called.
dynamic_thread_pool_group::current_work_item()
will always be this
during this call.