activemq-cpp-3.6.0
|
This extends Scherer-Scott dual queue algorithm, differing, among other ways, by using modes within nodes rather than marked pointers. More...
#include <src/main/decaf/internal/util/concurrent/TransferQueue.h>
Public Member Functions | |
TransferQueue () | |
Node class for TransferQueue. | |
virtual | ~TransferQueue () |
virtual void | transfer (E *e, bool timed, long long nanos) |
Performs a put. | |
virtual E * | transfer (bool timed, long long nanos) |
Performs a take. |
This extends Scherer-Scott dual queue algorithm, differing, among other ways, by using modes within nodes rather than marked pointers.
The algorithm is a little simpler than that for stacks because fulfillers do not need explicit nodes, and matching is done by CAS'ing QNode.item field from non-null to null (for put) or vice versa (for take).
|
inline |
Node class for TransferQueue.
Tries to cancel by CAS'ing ref to NULL if that succeeds then we mark as cancelled. Returns true if this node is known to be off the queue because its next pointer has been forgotten due to an advanceHead operation.
|
inlinevirtual |
|
inlinevirtual |
Performs a put.
e | the item to be handed to a consumer; |
timed | if this operation should timeout |
nanos | the timeout, in nanoseconds |
TimeoutException | if the operation timed out waiting for the consumer to accept the item offered. |
InterruptedException | if the thread was interrupted while waiting for the consumer to accept the item offered. |
Implements decaf::internal::util::concurrent::Transferer< E >.
|
inlinevirtual |
Performs a take.
timed | if this operation should timeout |
nanos | the timeout, in nanoseconds |
TimeoutException | if the operation timed out waiting for the producer to offer an item. |
InterruptedException | if the thread was interrupted while waiting for the producer to offer an item. |
Implements decaf::internal::util::concurrent::Transferer< E >.
References NULL.