Comments (3)
I have solved it by changing the BLOCK_SIZE, tks
from concurrentqueue.
Interesting! You're actually hitting the limit on the IMPLICIT_INITIAL_INDEX_SIZE
. By default, this is 32, and so is the BLOCK_SIZE
. Since no one is dequeueing from the queue, the index fills up (one entry is taken for each block inserted) until it's completely full. This happens after 32 blocks, which means 32*32 elements -- this is where the 1024 limit is coming from. try_enqueue
is not allowed to allocate memory, so it fails when the block index is full.
I admit this is not something I had thought about when designing the queue. It's a little unfortunate. Sorry!
You'll need to change IMPLICIT_INITIAL_INDEX_SIZE
(or EXPLICIT_INITIAL_INDEX_SIZE
if using explicit tokens) to something at least as large as 10000000/BLOCK_SIZE
if you want to enqueue without ever allocating new memory. A good balance would probably be blocks of around 1024-8192 and a corresponding index size of 16K-2K.
from concurrentqueue.
Tks for your reply. I got it . Tks very much!
from concurrentqueue.
Related Issues (20)
- Memory Leak HOT 6
- [feature-request] Associating ProducerToken & ConsumerToken explicitly
- segment fault
- Occasionally program can be stuck inside try_dequeue of blockingconcurrentqueue.h HOT 1
- installed concurrentqueue using vcpkg, but can not make.
- try_dequeue_bulk core dump. HOT 2
- Introducing LIFO semaphore
- Waiting without dequeuing HOT 1
- ConcurrentQueue ~150x slower on Windows HOT 11
- Naming conflict HOT 2
- About license HOT 1
- Weird dequeue behavior HOT 8
- Linux fs.h causes compilation problems HOT 4
- To use one concurrent queue between multiple threads HOT 3
- GLIBC version requires 2.30, but deploy platform has 2.29 only
- try_enqueue takes up to 1024 elements, regardless of initial capacity HOT 4
- wait_dequeue occasionally not working properly HOT 5
- q.try_dequeue(...) Get exception EXC_BAD_ACCESS (code=1, address=0x0) HOT 1
- Dequeue a list using an std::vector HOT 1
- How to use Concurrent queue with std::vector HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from concurrentqueue.