comparison BlockingQueue.h @ 44:67c7f5a0308b

Renamed VMS to PR, in new branch
author Sean Halle <seanhalle@yahoo.com>
date Fri, 08 Mar 2013 05:40:08 -0800
parents d01d48b023ca
children 8c0dcf6e15e6
comparison
equal deleted inserted replaced
6:5403adb0b543 7:b151681711ab
24 typedef 24 typedef
25 struct 25 struct
26 { pthread_mutex_t mutex_t; 26 { pthread_mutex_t mutex_t;
27 pthread_cond_t cond_w_t; 27 pthread_cond_t cond_w_t;
28 pthread_cond_t cond_r_t; 28 pthread_cond_t cond_r_t;
29 int count; 29 int32 count;
30 int readPos; 30 int32 readPos;
31 int writePos; 31 int32 writePos;
32 void* data[1024]; //an array of pointers 32 void* data[1024]; //an array of pointers
33 int w_empty; 33 int w_empty;
34 int w_full; 34 int w_full;
35 } 35 }
36 PThdQueueStruc; 36 PThdQueueStruc;
41 41
42 42
43 //========== CAS based queue ========== 43 //========== CAS based queue ==========
44 typedef 44 typedef
45 struct 45 struct
46 { volatile int insertLock; 46 { volatile int32 insertLock;
47 volatile int extractLock; 47 volatile int32 extractLock;
48 volatile void* *insertPos; 48 volatile void* *insertPos;
49 volatile void* *extractPos; 49 volatile void* *extractPos;
50 void* startOfData[1024]; //data is pointers 50 void* startOfData[1024]; //data is pointers
51 void* *endOfData; //set when make queue 51 void* *endOfData; //set when make queue
52 } 52 }
74 74
75 75
76 //========= non-atomic instr S R M W queue =========== 76 //========= non-atomic instr S R M W queue ===========
77 typedef 77 typedef
78 struct 78 struct
79 { int lastQReadFrom; 79 { int32 lastQReadFrom;
80 int numInternalQs; 80 int32 numInternalQs;
81 int internalQsSz; 81 int32 internalQsSz;
82 SRSWQueueStruc* *internalQs; 82 SRSWQueueStruc* *internalQs;
83 } 83 }
84 SRMWQueueStruc; 84 SRMWQueueStruc;
85 85
86 SRMWQueueStruc* makeSRMWQ(); 86 SRMWQueueStruc* makeSRMWQ();