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
Add a ThreadPool concept for CoreContext #546
Conversation
04e281d
to
5932e6b
Compare
The thread pool concept allows users to attach a lambda to the context to be executed by that context's thread pool. By default, contexts receive the thread pool of their parent, and the global context gets the default thread pool for the system. Contexts assign their thread pool to the thread pool of their parent upon initiation (not construction). Prior to initiation, contexts hold the null thread pool, which is an instance of NullPool that simply accumulates dispatchers until the parent context is initiated, shut down, or destroyed. Setting a context's thread pool will not cause the context to release its reference to the NullPool. Instead, the provided thread pool will be held until the context is started, and when this happens, all dispatchers will be transferred to the requested pool and then the requested pool will be initiated. Jobs added to a context's thread pool will not be run until the context is started.
5932e6b
to
7b6b95a
Compare
I have 4 failing tests on Mac:
Which is every |
Can you print the failure messages? |
The appended lambdas seem to not run consistently. They tests fail because the |
Sure thing, thanks for the help. |
Lowering it to 5 should be fine. |
OK, I'm able to get the same failure. I'm looking into this now. |
Add a ThreadPool concept for CoreContext
The thread pool concept allows users to attach a lambda to the context to be executed by that context's thread pool. By default, contexts receive the thread pool of their parent, and the global context gets the default thread pool for the system. Contexts assign their thread pool to the thread pool of their parent upon initiation (not construction). Prior to initiation, contexts hold the null thread pool, which is an instance of NullPool that simply accumulates dispatchers until the parent context is initiated, shut down, or destroyed.
Setting a context's thread pool will not cause the context to release its reference to the NullPool. Instead, the provided thread pool will be held until the context is started, and when this happens, all dispatchers will be transferred to the requested pool and then the requested pool will be initiated.
Jobs added to a context's thread pool will not be run until the context is started.