George Russell [EMAIL PROTECTED] writes:
"Sigbjorn Finne (Intl Vendor)" wrote:
Is it worth adding something like `yield' to the Concurrent
API? I'm unconvinced, but don't feel strongly about it. If
there are others that also think that it should be supported,
let me know, and I'll change my mind :-)
Here are two reasons:
(1) Pre-emptive scheduling is hard to implement (is Hugs
really going to support it and still be as portable as it
is now??). Presumably this is why Java is not guaranteed
to have it.
That's the plan - it's usually not that hard to find enough OS
support to make the implementation of this possible.
(2) Even when you have pre-emptive scheduling, yield() could
still provide a hint to the scheduler that this might be
a good time to do something else.
The scheduler will pretty soon get around to context switching
anyway, but ok.
There's no persuasive reasons for not supporting it, so
we'll add it.
--sigbjorn