Sujet : Re: Continuations
De : johnl (at) *nospam* taugh.com (John Levine)
Groupes : comp.archDate : 14. Jul 2024, 23:29:05
Autres entêtes
Organisation : Taughannock Networks
Message-ID : <v71jfh$jko$1@gal.iecc.com>
References : 1 2 3 4
User-Agent : trn 4.0-test77 (Sep 1, 2010)
According to Niklas Holsti <
niklas.holsti@tidorum.invalid>:
This programming style is very old. The SAGE air defense system used
it in the 1950s, and SABRE copied it in the early 1960s. The software
was oranizaed into routines each of which took some input, did
something with it, perhaps scheduled other I/O operations, and then
explicitly saved its state and returned to the dispatcher.
>
I think that looks more like a multi-tasking system with
run-to-completion, non-preemptive (small) tasks, considering each
"routine" as a task and assuming that each routine started with
recovering its saved context.
Right, that saved context is the continuation. Like I said, the tools
these days take care of a lot of the drudge work, e.g. node.js.
The main difference to present-day multi-tasking systems is then that
the context-saving and -restoring was implemented separately and
specifically in each task, and not in a shared "task switch" function.
Not really. The context is specific to each routine. It's not like
time-slicing, it's do as much work as you can and then block for I/O.
The context you save depends on what you're doing.
Could you explain a bit about the "dispatcher" and how it decided which
routine to execute next? Perhaps depending on which I/O had completed?
As best I understand it, SABRE would receive a message from one of the
terminals and dispatch it to a routine based on the first few
characters that said what kind of request it was. The routine would
then do a bunch of work consisting of computing and disk I/O. Whenever
it scheduled a disk operation, it'd explicitly save its state and
return to the dispatcher. When the disk I/O was done, it'd schedule
the next part of the task which restored the state and continued.
Repeat until the task sends a reply to the terminal and is done.
Airline reservation and credit card systems still work this way, and
have amazing transaction rates, like 1000 updates/sec to an individual
database record.
-- Regards,John Levine, johnl@taugh.com, Primary Perpetrator of "The Internet for Dummies",Please consider the environment before reading this e-mail. https://jl.ly