Concurrency
- FIXME
In Development
switch.py: show task switchingparent.py: show greenlet ID and parentageclasses.py: use objects instead of bare functions- but
set_othermethod is clumsy: how should we connect them?
- but
scheduler.py: a queue of runnable tasks is the parent of all taskscatch.py: show that uncaught exceptions are caught by parent greenlet- error handling is the hardest part of concurrency
inject.py: pass values into greenlets when resuming them- call to
.rungets the first value passed in .switchreturns a value- exercise: use
.throwto raise an exception in a greenlet from the outside
- call to
resource.py: busy-wait competition for shared resource- wasteful
wait.py: resource keeps track of who is waiting and who is ready to run- all scheduling done by the scheduler
- if first attempt to acquire fails, acquire again when rescheduled