2 ms·
> tasks are now migrated across threads by the scheduler, whereas in the old scheduler a single task was always run in the same thread. Is that done by having
by masklinn 13y ago
> tasks are now migrated across threads by the scheduler, whereas in the old scheduler a single task was always run in the same thread.
Is that done by having a single task queue with multiple schedulers, or through work-stealing by schedulers with no ready tasks in their queue?
Would this open the possibility of configuring schedulers (including individually)? E.g. ensuring a given task stays pinned on a specific scheduler, and said scheduler accepts no more task, that kind of things?
- smosher 13y ago> Would this open the possibility of configuring schedulers ... I've been assured that it's the plan. I have no idea how much of it works right now though. I've only done one build with the new rt and it doesn't involve tasks.
- masklinn 13y ago> I've been assured that it's the plan. Excellent [twirls mustache] > I have no idea how much of it works right now though. Yeah I don't expect it to work at this point, but knowing it's one of the end-goals is good.
- pcwalton 13y ago> Is that done by having a single task queue with multiple schedulers, or through work-stealing by schedulers with no ready tasks in their queue? Right now it's the former, but Aaron Todd has a pull request to switch it to the latter.
- brson 13y agoThe implementation on master currently uses a single queue, but very shortly it will be converted to work stealing. Tasks can be 'pinned' to their own scheduler (i.e. thread) with `spawn_sched(SingleThreaded)`, and this is very important for tasks that call foreign code that blocks. That's about the extent of the configurability at the moment, but I anticipate at least one other 'mode' in the future for coping with blocking tasks that don't want to be pinned to a specific thread.