You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The channel is unbounded which means it could use a lot of memory if the worker threads is blocked, e.g. by a long running actor.
It requires the involvement of the worker thread to schedule the actor, it would be nice if this could be done directly.
Towards a new implementation
Requirements:
Accessible from any thread. We don't control from which thread the task::Waker implementation is called.
The worker thread that owns the scheduler in which the to-be-awoken actor runs must not be blocked. I.e. removing a process from the ready queue mustn't block.
Would be nice if we didn't do a large amount of work if the process is already marked as ready-to-run, or was stopped.
Possible implementations
I thought of two possible implementations:
A concurrent hashset. The waker implementation would add the process id to the set when waking, the worker thread would then drain the set and schedule all actors based on the process ids. Benefit over the current implementation is that it's not unbounded, but not much more.
Directly schedule the actor in the thread-local scheduler. We already do this for the thread-safe scheduler. The downside of this is that we lose the benefit over having a thread-local scheduler to begin with.
The text was updated successfully, but these errors were encountered:
The
task::Waker
implementation for the thread-local actors is currently based on sending it's process id into an unbounded channel. The worker thread reads from this channel and schedules the actors accordingly. The current implementation is located here: https://github.com/Thomasdezeeuw/heph/blob/40984a97301706e32e7237a1535a7d06f5e157e7/src/rt/waker.rs.This has two problems:
Towards a new implementation
Requirements:
task::Waker
implementation is called.Possible implementations
I thought of two possible implementations:
The text was updated successfully, but these errors were encountered: