Threads vs. continuations

John Nagle nagle at animats.com
Tue Feb 19 20:04:17 EST 2008


Tim Daneliuk wrote:
> Martin v. Löwis wrote:

> Is/Was it not the case, though, that some languages present
> a threading model to the programmer that is realized in user
> space, but not in the kernel.  ISTR some early implementations
> of Posix Threads that worked that way.  The API was there
> and was correct, but - since everything was actually running
> in user space - when a single "thread" blocked, they all did.

    People did things like that to hammer threading onto operating
systems so dumb they couldn't context switch, like
DOS, early Windows, and MacOS through 7.  Nobody does that
any more.

    For one thing, it's easier to build a real scheduler
than to build the hacks for working without one.  (Mac programmers
referred to this as the Mess Inside - no real CPU dispatcher, but
"deferred tasks", "timer tasks", "vertical interval tasks", and
similar hacks to work around the lack of one.)

				John Nagle



More information about the Python-list mailing list