It requires the user to provide the allocated memory slots for the exchange (data) and coordination buffers.
Parameters
[in]
coordinationCommunicationManager
The backend's memory manager to facilitate communication between the producer and consumer coordination buffers
[in]
payloadCommunicationManager
The backend's memory manager to facilitate communication between the producer and consumer payload buffers
[in]
coordinationBuffer
This is a small buffer that needs to be allocated at the producer side. enables the consumer to signal how many tokens it has popped. It may also be used for other coordination signals.
[in]
tokenSize
The size of each token.
[in]
capacity
The maximum number of tokens that will be held by this channel
If the current channel is a consumer, it corresponds to how many tokens may yet be consumed. If the current channel is a producer, it corresponds the channel capacity minus the returned value equals how many tokens may still be pushed.
Note
This is not a thread-safe call
This is a getter function that should complete in time.
Returns
The number of tokens in this channel.
This function when called on a valid channel instance will never fail.