Giter Club home page Giter Club logo

Comments (3)

chenspnjupt avatar chenspnjupt commented on June 15, 2024

I have solved it by changing the BLOCK_SIZE, tks

from concurrentqueue.

cameron314 avatar cameron314 commented on June 15, 2024

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.

chenspnjupt avatar chenspnjupt commented on June 15, 2024

Tks for your reply. I got it . Tks very much!

from concurrentqueue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.