Unique identifier for tracking asynchronous operations executing on a device context.
The EventID is used to track the completion status of asynchronous operations such as buffer reads and writes. Each EventID represents a unique operation and provides a mechanism to query completion status or wait for operation completion.
Key characteristics of EventID:
EventIDs are commonly used with:
// Create events to track multiple async operations var writeEvent = context.CreateEvent(); var readEvent = context.CreateEvent();
// Start async write operation context.WriteBuffer(bufferSlice, inputData, writeEvent);
// Start async read operation (depends on write completing) context.ReadBuffer(bufferSlice, outputData, readEvent);
// Submit all operations for execution context.Flush();
// Wait for write to complete before proceeding bool writeSuccess = context.Wait(writeEvent); Assert.IsTrue(writeSuccess);
// Check if read completed without blocking if (context.IsCompleted(readEvent)) { Debug.Log("Read operation completed"); } else { // Wait for read to complete bool readSuccess = context.Wait(readEvent); Assert.IsTrue(readSuccess); }
// Clean up events. context.DestroyEvent(writeEvent); context.DestroyEvent(readEvent);
Property | Description |
---|---|
Value | The underlying event identifier value. |
Constructor | Description |
---|---|
EventID | Construct a new EventID object. |