preemptive vs cooperative: attempt at formalization
simonmar at microsoft.com
Wed Apr 12 11:26:17 EDT 2006
On 12 April 2006 11:41, Malcolm Wallace wrote:
> John Meacham <john at repetae.net> wrote:
>> In a concurrent implementation, a thread performing an infinite loop
>> with no IO or interaction with the outside world can potentially
>> stall switching to another thread forever, in FP, we usually denote
>> an infinite loop by _|_. so I think the first difference would be:
> By infinite loop, you mean both non-terminating, and non-productive.
> A non-terminating but productive pure computation (e.g. ones =
> 1:ones) is not necessarily a problem.
That's slightly odd terminology. ones = 1:ones is definitely
terminating. (length ones) is not, though.
> Why? Because ultimately the
> demand that forces production of the infinite data structure must
> come from somewhere, and that somewhere must essentially be I/O.
> (The only alternative consumers are terminating pure (no problem),
> non-terminating productive pure (so look upward to its demand), or an
> unproductive non-terminating computation, which brings us full
> It is a curious artifact that in certain multi-threaded
> implementations, a non-terminating non-productive thread does not
> make the entire system unproductive,
Wow. I wish I knew what that meant :)
Maybe you could expand on in what sense you mean non-terminating, and
what "productive" means? Is there something we need to worry about
More information about the Haskell-prime