playform
playform copied to clipboard
More coherent scheduling
One approach used near the top-level of client and server is to iterate through a closure until it returns "yes I'm done do the next thing", e.g. fetching network input. Another one used slightly further down is to run things for a set amount of time. We could probably merge these two strategies and get better overall behavior with less code.
In general we want a threading/scheduling mechanism that lets us say at least:
- X thread can't be starved for much longer than T
- X thread is more important than Y thread