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
Merged

Fix job queue crash #4335

merged 2 commits into from
May 2, 2018

Conversation

lukas-w
Copy link
Member

@lukas-w 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.

* Don't add jobs when job queue is full
* Icrease job queue size from 1024 to 8192
@Wallacoloo
Copy link
Member

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 06:18
@lukas-w
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
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.

Hopefully makes it less confusing that m_writeIndex grows beyond
JOB_QUEUE_SIZE when the queue is full.
@lukas-w
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
@lukas-w lukas-w deleted the fix/job-queue branch May 2, 2018 10:55
sdasda7777 pushed a commit to sdasda7777/lmms that referenced this pull request Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants