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

Allow a single ThreadPool to run jobs in both modes #1837

Open
wants to merge 3 commits into
base: 8.3.0-Dev
Choose a base branch
from

Conversation

player-03
Copy link
Contributor

There are enough use cases for both types of job that it's likely some users will want to use both. Before this PR, this required creating two ThreadPools, one for each mode. Now, you only need the one.

If you call run() without passing the new mode argument, it falls back to the pool's mode, just like before.

Since we're storing more and more in `JobData`, and the background thread only needs three bits of that data, I added those to `ThreadEvent` so we don't have to pass the full object. This may improve performance in HTML5 specifically, where passing a class instance incurs an overhead.
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.

1 participant