pub struct Context {
    pub id: usize,
    /* private fields */
}
Expand description

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.

Fields

id: usize

A unique identifier for this context

Implementations

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.

Trait Implementations

Formats the value using the given formatter. Read more

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.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.