PPL Logo

arch/util/pcqueue.h File Reference

Producer-Consumer Queues

This queue implementation enables a producer and a consumer to communicate via a queue. More...

Go to the source code of this file.

Data Structures

struct  CircQueueStruct
 The simple version of pcqueue has dropped the function of being expanded if the queue is full. More...
struct  PCQueueStruct
 The beginning of definitions for simple pcqueue. More...
struct  PCQueueStruct
 The beginning of definitions for simple pcqueue. More...
struct  FreeNodePoolStruct
struct  MPSCQueueStruct
struct  MPMCDataNodeStruct
struct  FreeMPMCNodePoolStruct
struct  MPMCQueueStruct

Typedefs

typedef struct CircQueueStructCircQueue
typedef struct PCQueueStructPCQueue
typedef char ** DataNode
typedef struct FreeNodePoolStructFreeNodePool
typedef struct MPSCQueueStructMPSCQueue
typedef struct MPMCDataNodeStructMPMCDataNode
typedef struct
FreeMPMCNodePoolStruct
FreeMPMCNodePool
typedef struct MPMCQueueStructMPMCQueue

Functions

static PCQueue PCQueueCreate (void)
static void PCQueueDestroy (PCQueue Q)
static int PCQueueEmpty (PCQueue Q)
static int PCQueueLength (PCQueue Q)
static char * PCQueueTop (PCQueue Q)
static char * PCQueuePop (PCQueue Q)
static void PCQueuePush (PCQueue Q, char *data)
void ReportOverflow ()
static unsigned int WrappedDifference (unsigned int push, unsigned int pull)
static int QueueFull (unsigned int push, unsigned int pull)
static DataNode DataNodeCreate (void)
static FreeNodePool FreeNodePoolCreate (void)
static void FreeNodePoolDestroy (FreeNodePool q)
static DataNode get_free_node (FreeNodePool q)
static void add_free_node (FreeNodePool q, DataNode available)
static MPSCQueue MPSCQueueCreate (void)
static void MPSCQueueDestroy (MPSCQueue Q)
static unsigned int get_node_index (unsigned int value)
static DataNode get_push_node (MPSCQueue Q, unsigned int push_idx)
static DataNode get_pop_node (MPSCQueue Q, unsigned int pull_idx)
static void check_mem_reclamation (MPSCQueue Q, unsigned int pull_idx, DataNode node)
static int MPSCQueueEmpty (MPSCQueue Q)
static int MPSCQueueLength (MPSCQueue Q)
static char * MPSCQueueTop (MPSCQueue Q)
static char * MPSCQueuePop (MPSCQueue Q)
static void MPSCQueuePush (MPSCQueue Q, char *data)
static MPMCDataNode MPMCDataNodeCreate (void)
static FreeMPMCNodePool FreeMPMCNodePoolCreate (void)
static void FreeMPMCNodePoolDestroy (FreeMPMCNodePool q)
static MPMCDataNode mpmc_get_free_node (FreeMPMCNodePool q)
static void mpmc_add_free_node (FreeMPMCNodePool q, MPMCDataNode available)
static MPMCQueue MPMCQueueCreate (void)
static void MPMCQueueDestroy (MPMCQueue Q)
static MPMCDataNode mpmc_get_push_node (MPMCQueue Q, unsigned int push_idx)
static MPMCDataNode mpmc_get_pop_node (MPMCQueue Q, unsigned int pull_idx)
static void mpmc_check_mem_reclamation (MPMCQueue Q, unsigned int pull_idx, MPMCDataNode node)
static int MPMCQueueEmpty (MPMCQueue Q)
static int MPMCQueueLength (MPMCQueue Q)
static char * MPMCQueueTop (MPMCQueue Q)
static char * MPMCQueuePop (MPMCQueue Q)
static void MPMCQueuePush (MPMCQueue Q, void *data)

Variables

int DataNodeSize
int MaxDataNodes
int QueueUpperBound
int DataNodeWrap
int QueueWrap
int messageQueueOverflow


Detailed Description

Producer-Consumer Queues

This queue implementation enables a producer and a consumer to communicate via a queue.

The queues are optimized for this situation, they don't require any operating system locks (they do require 32-bit reads and writes to be atomic.) Cautions: there can only be one producer, and one consumer. These queues cannot store null pointers.

Definition in file pcqueue.h.


Generated on Mon Sep 21 07:56:48 2020 for Charm++ by  doxygen 1.5.5