70#include <cx/thread/aspin.h>
74#if DEBUG_LEVEL >= 2 && _64BIT
89typedef struct PrqSegment PrqSegment;
92typedef struct PrqPerfStats {
94 atomic(uint64) grow_collision;
95 atomic(uint64) shrink;
96 atomic(uint64) shrink_collision;
97 atomic(uint64) head_contention;
98 atomic(uint64) reserved_contention;
100 atomic(uint64) push_optimal;
101 atomic(uint64) push_fast;
102 atomic(uint64) push_slow;
103 atomic(uint64) push_appeared_full;
104 atomic(uint64) push_actually_full;
105 atomic(uint64) push_collision;
106 atomic(uint64) push_retry;
107 atomic(uint64) push_full_retry;
108 atomic(uint64) push_noreserve_retiring;
110 atomic(uint64) pop_optimal;
111 atomic(uint64) pop_fast;
112 atomic(uint64) pop_slow;
113 atomic(uint64) pop_nonobvious_empty;
114 atomic(uint64) pop_assist;
115 atomic(uint64) pop_assist_fail;
116 atomic(uint64) pop_segtraverse;
117 atomic(uint64) pop_collision;
118 atomic(uint64) gc_run;
119 atomic(uint64) seg_retired;
120 atomic(uint64) seg_dealloc;
121 atomic(uint64) seg_dealloc_failinuse;
163 atomic(int32) access;
167 atomic(uint32) chgtime;
188typedef struct PrqSegment {
198 PrqSegment* nextretired;
212 atomic(uint32) count;
222 atomic(uint32) reserved;
225 atomic(ptr) buffer[];
272_Success_(
return)
bool prqPush(_Inout_
PrQueue* prq, _Pre_notnull_ _Post_invalid_
void* ptr);
bool prqDestroy(PrQueue *prq)
bool prqPush(PrQueue *prq, void *ptr)
PrqGrowthEnum
How much a dynamic PrQueue grows or shrinks by when it resizes.
void prqInitDynamic(PrQueue *prq, uint32 minsz, uint32 targetsz, uint32 maxsz, PrqGrowth growth, PrqGrowth shrink)
uint32 prqCount(PrQueue *prq)
void * prqPeek(PrQueue *prq, uint32 n)
bool prqCollect(PrQueue *prq)
void * prqPop(PrQueue *prq)
void prqInitFixed(PrQueue *prq, uint32 sz)
enum PrqGrowthEnum PrqGrowth
How much a dynamic PrQueue grows or shrinks by when it resizes.
@ PRQ_Grow_100
Resize by 100% (default)
@ PRQ_Grow_150
Resize by 150%.
@ PRQ_Grow_200
Resize by 200%.
@ PRQ_Grow_25
Resize by 25%.
@ PRQ_Grow_None
Do not grow/shrink at all.
@ PRQ_Grow_50
Resize by 50%.
Mutex synchronization primitive.