pub struct Context {
pub id: usize,
// some fields omitted
}
A list of all task groups spawned by a function in some launch context which
will be sync'd at an explicit sync
call or function exit.
Note: A Context is done if and only if ISPCSync
has been called with
its handle and all of its tasks are finished. Until ISPCSync
is called on the
Context's handle more tasks could be launched.
Additionally, because we're not really able to associate a call to ISPCAlloc
with a specific Group care must be taken that the Context is not dropped
until ISPCSync
has been called on its handle and all Groups within have
completed execution.
A unique identifier for this context
Create a new list of tasks for some function with id id
Add a task group for execution that was launched in this context
Check if all tasks currently in the task list are completed
Note: A Context is done if and only if ISPCSync has been called with
its handle and all of its tasks are finished. Until ISPCSync is called on the
Context's handle more tasks could be launched.
TODO: With this design we're essentially requiring the thread waiting on the context
to busy wait since we provide no condition variable to block on.
Allocate some memory for this Context's task groups, returns a pointer to the allocated memory.
An iterator over the current groups in the context which have remaining tasks to
run on a thread. If more task groups are added before this iterator has returned
None those will appear as well.
Release memory for all the tasks in this context
Note: that because we're not really able to associate a call to ISPCAlloc
with a specific Group care must be taken that the Context is not dropped
until ISPCSync has been called on its handle and all Groups within have
completed execution.
Formats the value using the given formatter. Read more
type Error = !
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Mutably borrows from an owned value. Read more