[<<][sm][>>][..]
Sat Jan 11 18:03:58 CET 2020

Implementing scheduler

Does it needs queues?
I don't thing we really care about sched order.

Is there a simpler DS that can mark a channel for a waiting task?
Yes, but it also then needs to undo the wait in case of select.

Might be simpler if the number of channels is small.

So: fun from chan -> (ks,kr)

I'm getting too tired for data structures.

Actually, can scheduling be done using a stack instead?  Or maybe
implementing a queue using two stacks.

EDIT: Revisit from perspective of suspend.

Basically, it is always possible to start from a state where
everything blocks, because the input of the network can be monitored.
I.e. channels that represent timers or I/O events.

So whenever something happens, it is time to start scheduling.  This
can be done depth-first:

- event happens on channel c0, e.g. from timer or external something.

- there will always be a reader on this channel because the system is
  in a "relaxed" state.  execute it.

- it will produce a new continuation.  if it is a send, there will be
  a corresponding receive.  why?  same case as before: there is no
  other way the system can advance.

- if it is a receive, check the queues for a send.

Maybe it's not great to think about this in a tired state.

EDIT: It's wrong.  Reads and writes seem to be really symmetric.  It
doesn't really seem to matter what happens between the two tasks.
It's only important that they meet.  Wingo was really stressing this,
and it seems to be true from the scheduler's point.  The reason to
have two queues is just a filter.  Let's assume schedulable tasks are
a set.




[Reply][About]
[<<][sm][>>][..]