Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix job queue crash #4335

Merged
merged 2 commits into from May 2, 2018

Conversation

Projects
None yet
2 participants
@lukas-w
Copy link
Member

lukas-w commented Apr 29, 2018

  • Don't add jobs when job queue is full
  • Icrease job queue size from 1024 to 8192

Closes #777.

Fix job queue crash
* Don't add jobs when job queue is full
* Icrease job queue size from 1024 to 8192
@Wallacoloo

This comment has been minimized.

Copy link
Member

Wallacoloo commented May 2, 2018

It seems weird to let m_queueSize grow beyond JOB_QUEUE_SIZE (i.e. sizeof(m_items)). But the only other way I see to avoid that is to use testAndSetOrdered in a loop, which is arguably less intuitive (and more costly).

@Wallacoloo Wallacoloo self-requested a review May 2, 2018

@lukas-w

This comment has been minimized.

Copy link
Member Author

lukas-w commented May 2, 2018

@Wallacoloo How about renaming m_queueSize to something like m_queueIndex or m_writeIndex, would that make it less contradictory?

@Wallacoloo

This comment has been minimized.

Copy link
Member

Wallacoloo commented May 2, 2018

Either of the ones you suggested would be a little better than m_queueSize. Not worth spending much time nitpicking over a variable name though.

JobQueue: Rename m_queueSize to m_writeIndex
Hopefully makes it less confusing that m_writeIndex grows beyond
JOB_QUEUE_SIZE when the queue is full.
@lukas-w

This comment has been minimized.

Copy link
Member Author

lukas-w commented May 2, 2018

Renamed to m_writeIndex.

@lukas-w lukas-w merged commit af61a82 into stable-1.2 May 2, 2018

0 of 3 checks passed

ci/circleci CircleCI is running your tests
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details

@lukas-w lukas-w deleted the fix/job-queue branch May 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.