Re: Are Perl6 threads preemptive or cooperative?
[email protected] (Dan Sugalski) Fri, 25 Aug 2000 14:07:11 -0400
| Newsgroups | perl.perl6.language.flow |
|---|---|
| Message-ID | <[email protected]> |
At 12:51 PM 8/25/00 -0500, David L. Nicol wrote: >Dan Sugalski wrote: > > > > At 02:49 AM 8/25/00 -0400, Steven W McDougall wrote: > > >Are Perl6 threads preemptive or cooperative? > > > > Perl 6 threads will use the native threading system on each platform. To do > > otherwise means an enourmous amount of mostly useless work. It's just not > > worth it. > >Nonsense. > >If we write the LCD case (works on a nonthreaded architecture) >using cooperative threads that each yield after so many morae, (like my >vaporware emulator does) the fake virtual threads can map to OS threads >as allowed per architecture, and it becomes a porting issue rather than a >language capability issue. Writing a threads package correctly is a non-trivial thing to do. (Look at how many systems took forever to get it right, and some still haven't) It takes a lot of work, and a lot of thought, and it *still* needs some platform-specific code to work right. Perl doesn't currently run on a system that doesn't have a reasonably good threading library. Writing our own code would mean dedicating a few programmer-months to do poorly what other folks have spent quite a few programmer-years to do well. (Or at least less poorly... :) Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai [email protected] have teddy bears and even teddy bears get drunk