The goals of the concurrency standard?

John Meacham john at repetae.net
Wed Apr 12 06:29:36 EDT 2006


On Wed, Apr 12, 2006 at 11:19:53AM +0100, Simon Marlow wrote:
> I'll argue that point :)  GHC makes run-time checks at safe points and
> implements preemptive concurrency.  Cooperative scheduling is when the
> *programmer* has to insert the safe points.

the programmer of the standard libraries or low level FFI interfaces.
not the end programmer. I would be highly surprised if anyone other than
system or very low level library implementors ever actually needed to
use an explicit 'yield'. certainly a whole lot less often than they have
to add 'seq's and it is a lot more clear when they are needed :)

> The safe points don't even have to be very often: in GHC the context
> switch check is made after every 4k of allocation.

indeed, which means GHC technically doesn't meet the preemptive
requirements since a tight mathematical non-allocating loop can halt it.

in order to do true preemption, you'd need to respond to SIGALRM or
something like that, which can be quite tricky.

        John

-- 
John Meacham - ⑆repetae.net⑆john⑈


More information about the Haskell-prime mailing list