2828#include " boostqueue.h"
2929#include " tbbqueue.h"
3030#include " stdqueue.h"
31+ #include " dlibqueue.h"
3132#include " ../tests/common/simplethread.h"
3233#include " ../tests/common/systemtime.h"
3334#include " cpuid.h"
@@ -192,7 +193,7 @@ enum queue_id_t
192193 queue_simplelockfree,
193194 queue_lockbased,
194195 queue_std,
195-
196+ queue_dlib,
196197 QUEUE_COUNT
197198};
198199
@@ -204,6 +205,7 @@ const char QUEUE_NAMES[QUEUE_COUNT][64] = {
204205 " SimpleLockFreeQueue" ,
205206 " LockBasedQueue" ,
206207 " std::queue" ,
208+ " dlib::pipe"
207209};
208210
209211const char QUEUE_SUMMARY_NOTES [QUEUE_COUNT ][128 ] = {
@@ -214,6 +216,7 @@ const char QUEUE_SUMMARY_NOTES[QUEUE_COUNT][128] = {
214216 " " ,
215217 " " ,
216218 " single thread only" ,
219+ " "
217220};
218221
219222const bool QUEUE_TOKEN_SUPPORT [QUEUE_COUNT ] = {
@@ -224,6 +227,7 @@ const bool QUEUE_TOKEN_SUPPORT[QUEUE_COUNT] = {
224227 false ,
225228 false ,
226229 false ,
230+ false
227231};
228232
229233const int QUEUE_MAX_THREADS [QUEUE_COUNT ] = {
@@ -234,6 +238,7 @@ const int QUEUE_MAX_THREADS[QUEUE_COUNT] = {
234238 -1 ,
235239 -1 ,
236240 1 ,
241+ -1
237242};
238243
239244const bool QUEUE_BENCH_SUPPORT [QUEUE_COUNT ][BENCHMARK_TYPE_COUNT ] = {
@@ -244,6 +249,7 @@ const bool QUEUE_BENCH_SUPPORT[QUEUE_COUNT][BENCHMARK_TYPE_COUNT] = {
244249 { 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 },
245250 { 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 },
246251 { 0 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 },
252+ { 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 }
247253};
248254
249255
@@ -1984,6 +1990,9 @@ int main(int argc, char** argv)
19841990 case queue_std:
19851991 maxOps = determineMaxOpsForBenchmark<StdQueueWrapper<int >>((benchmark_type_t )benchmark, nthreads, (bool )useTokens, seed);
19861992 break ;
1993+ case queue_dlib:
1994+ maxOps = determineMaxOpsForBenchmark<DlibQueueWrapper<int >>((benchmark_type_t )benchmark, nthreads, (bool )useTokens, seed);
1995+ break ;
19871996 default :
19881997 assert (false && " There should be a case here for every queue in the benchmarks!" );
19891998 }
@@ -2017,6 +2026,9 @@ int main(int argc, char** argv)
20172026 case queue_std:
20182027 elapsed = runBenchmark<StdQueueWrapper<int >>((benchmark_type_t )benchmark, nthreads, (bool )useTokens, seed, maxOps, maxThreads, ops);
20192028 break ;
2029+ case queue_dlib:
2030+ elapsed = runBenchmark<DlibQueueWrapper<int >>((benchmark_type_t )benchmark, nthreads, (bool )useTokens, seed, maxOps, maxThreads, ops);
2031+ break ;
20202032 default :
20212033 assert (false && " There should be a case here for every queue in the benchmarks!" );
20222034 }
0 commit comments