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

Synchronize input event processing #4998

Merged
merged 1 commit into from Apr 17, 2017

Conversation

Projects
None yet
2 participants
@JakubValtar
Contributor

JakubValtar commented Apr 9, 2017

Some renderers (OpenGL) fire events on background threads, which can corrupt the event queue when the sketch is not looping and multiple threads add and remove from the queue at the same time.

This PR uses blocking queue to serialize enqueuing and lock to synchronize dequeuing.

In the ideal case, we should be able to invoke code on the animation thread (ala invokeLater) and always dequeue events from there even when the sketch is not looping.

Synchronize input event processing
Some renderers (OpenGL) fire events on background threads, which can
corrupt the event queue when the sketch is not looping and multiple
threads add and remove from the queue at the same time.

This PR uses blocking queue to serialize enqueuing and lock to
synchronize dequeuing.

In the ideal case, we should be able to invoke code on the animation
thread (ala invokeLater) and always dequeue events from there even when
the sketch is not looping.

@benfry benfry merged commit 3850019 into processing:master Apr 17, 2017

@JakubValtar JakubValtar deleted the JakubValtar:synchronize-event-processing branch May 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment