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

Protect reads to SampleBuffer with read locks #2835

Merged
merged 1 commit into from
Jun 18, 2016
Merged

Conversation

jasp00
Copy link
Member

@jasp00 jasp00 commented Jun 11, 2016

This fixes #2833.

@Umcaruje
Copy link
Member

I don't think something like this can be accepted to the code base, since we want RT-safety in the core, and avoid adding any more locks. Please read up #1744 #1747 for a PR that was rejected and then redone in an RT-safe way.

@tresf
Copy link
Member

tresf commented Jun 13, 2016

If my vote counts, Stability > RT but I'm interested in seeing this conversation mature as I'm not an expert on the topic.

@jasp00
Copy link
Member Author

jasp00 commented Jun 13, 2016

SampleBuffer already relies on read and write locks, see SampleBuffer::play. The proposed fix is in line with the current implementation.
If lockless operation is desired, SampleBuffer should work like the mixer deleting tracks in #2822. Adding notes, handling MIDI events, loading settings, etc. should work like that: signal the mixer and wait until changes in the model are allowed.

@Spekular
Copy link
Member

@jasp00

already relies on read and write locks

This might be true, but

[we want to] avoid adding any more locks

@jasp00
Copy link
Member Author

jasp00 commented Jun 13, 2016

So, should I change the current operation of SampleBuffer and remove present locks?

Removed global lock from the Mixer
@jasp00
Copy link
Member Author

jasp00 commented Jun 18, 2016

I have removed some locks, some more could be removed. Besides fixing #2833, some freezing introduced with #2822 is fixed. I will merge this soon (less than 24 hours), since projects cannot be loaded in the master branch.

@grejppi grejppi closed this Jun 18, 2016
@grejppi grejppi reopened this Jun 18, 2016
@grejppi
Copy link
Contributor

grejppi commented Jun 18, 2016

(Sorry for the noise; that was my phone thinking I pressed something instead of scrolling)

@jasp00 jasp00 merged commit 5dd650b into LMMS:master Jun 18, 2016
@jasp00 jasp00 deleted the triple-fpe branch June 18, 2016 19:27
sdasda7777 pushed a commit to sdasda7777/lmms that referenced this pull request Jun 28, 2022
Defer updates to SampleBuffer
Removed global lock from the Mixer
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.

5 participants