@@ -91,7 +91,7 @@ The entire queue's implementation is contained in **one header**, [`concurrentqu
9191Simply download and include that to use the queue. The blocking version is in a separate header,
9292[ ` blockingconcurrentqueue.h ` ] [ blockingconcurrentqueue.h ] , that depends on [ ` concurrentqueue.h ` ] [ concurrentqueue.h ] and
9393[ ` lightweightsemaphore.h ` ] [ lightweightsemaphore.h ] . The implementation makes use of certain key C++11 features,
94- so it requires a fairly recent compiler (e.g. VS2012+ or g++ 4.8; note that g++ 4.6 has a known bug with ` std::atomic `
94+ so it requires a relatively recent compiler (e.g. VS2012+ or g++ 4.8; note that g++ 4.6 has a known bug with ` std::atomic `
9595and is thus not supported). The algorithm implementations themselves are platform independent.
9696
9797Use it like you would any other templated queue, with the exception that you can use
@@ -128,8 +128,12 @@ There's usually two versions of each method, one "explicit" version that takes a
128128per-consumer token, and one "implicit" version that works without tokens. Using the explicit methods is almost
129129always faster (though not necessarily by a huge factor). Apart from performance, the primary distinction between them
130130is their sub-queue allocation behaviour for enqueue operations: Using the implicit enqueue methods causes an
131- automatically-allocated thread-local producer sub-queue to be allocated (it is marked for reuse once the thread exits).
132- Explicit producers, on the other hand, are tied directly to their tokens' lifetimes (and are also recycled as needed).
131+ automatically-allocated thread-local producer sub-queue to be allocated.
132+ Explicit producers, on the other hand, are tied directly to their tokens' lifetimes (but are recycled internally).
133+
134+ In order to avoid the number of sub-queues growing without bound, implicit producers are marked for reuse once
135+ their thread exits. However, this is not supported on all platforms. If using the queue from short-lived threads,
136+ it is recommended to use explicit producer tokens instead.
133137
134138Full API (pseudocode):
135139
0 commit comments