-
-
Notifications
You must be signed in to change notification settings - Fork 444
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
Thread pinning #284
Labels
Comments
Have some question about threading. Can i create custom pipeline with some stages marked as single threaded? I need 2 stages what runs on main thread and 5 stages what multi threaded. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the problem you are trying to solve.
Pinning systems to threads is important to keep specific library calls on the main thread, prevent splitting of a module's systems across threads and to allow thread-safe systems to run on any thread at the same time.
Describe the solution you'd like
* Updated *
Introduce the concept of a main flecs thread which is the
ecs_progress()
thread / thread index 0 as far as flecs is concerned.For backward compatibility existing systems should run on the main thread unless specified otherwise
With the exception of the main thread, thread pinning should be always to be to a pseudo-thread, the flecs thread index could change at any time as long as the pinned systems don't run on different threads, this only has to be a specification at first.
For systems that are threadsafe there should be an easy way to mark them as such
Why something like
THREAD:0-N
would be a bad idea:Modules from different sources could hog the same thread and assumes flecs will spawn N threads, named threads are also better for debugging.
The text was updated successfully, but these errors were encountered: