Hi,
This is still quite non-deterministic.
I would crete a single goroutine that implements scheduling policy and
knowns about all task types, their priorities, deadlines, starvation,
etc.
Basically every task/goroutine has an associated task descriptor, and
do something along the lines:
func (t *Task) Schedule() {
t.sched <- t // tell the scheduler that we are waiting
<-t.run // let the scheduler decide when we can run
}
The centralized scheduler would be a bad idea for a 128-core system.
But it should be perfectly OK for an embed 1 or 2 core system.