decaf::internal::util::concurrent::TransferQueue< E > Class Template Reference

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>

Inheritance diagram for decaf::internal::util::concurrent::TransferQueue< E >:
Inheritance graph
[legend]

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.

Detailed Description

template<typename E>
class decaf::internal::util::concurrent::TransferQueue< E >

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).


Constructor & Destructor Documentation

template<typename E >
decaf::internal::util::concurrent::TransferQueue< E >::TransferQueue (  )  [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.

template<typename E >
virtual decaf::internal::util::concurrent::TransferQueue< E >::~TransferQueue (  )  [inline, virtual]

Member Function Documentation

template<typename E >
virtual E* decaf::internal::util::concurrent::TransferQueue< E >::transfer ( bool  timed,
long long  nanos 
) [inline, virtual]

Performs a take.

Parameters:
timed if this operation should timeout
nanos the timeout, in nanoseconds
Returns:
the item provided or received;
Exceptions:
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.

template<typename E >
virtual void decaf::internal::util::concurrent::TransferQueue< E >::transfer ( E *  e,
bool  timed,
long long  nanos 
) [inline, virtual]

Performs a put.

Parameters:
e the item to be handed to a consumer;
timed if this operation should timeout
nanos the timeout, in nanoseconds
Exceptions:
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 >.


The documentation for this class was generated from the following file:

Generated on 1 Dec 2014 for activemq-cpp-3.8.2 by  doxygen 1.6.1