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

[Q&A] SwapOnVSync can lose order when using multithreading? #1678

Open
bluelasers opened this issue Jul 10, 2024 · 2 comments
Open

[Q&A] SwapOnVSync can lose order when using multithreading? #1678

bluelasers opened this issue Jul 10, 2024 · 2 comments

Comments

@bluelasers
Copy link

Basically the condition wait becomes multi producer to single consumer. I am not sure this works the way you intend. This represents another type of priority inversion in terms of processing order. If one thread gets more time a frame can skip ahead or cause a frame drop. You use async logic without control logic.

@bluelasers
Copy link
Author

bluelasers commented Jul 10, 2024

Note there is a work around on the application side for this. So maybe document and close.

@hzeller
Copy link
Owner

hzeller commented Jul 10, 2024

Frames are emitted in the same order you call SwapOnVSync(), so if you feed from multiple threads and have a particular order in mind you need to order your calls to SwapOnVSync(), which is intended.

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

No branches or pull requests

2 participants