http://www.perlmonks.org?node_id=166573


in reply to (Ask Perl 6: Win32) Re: Re: Re: Builtin Watchdog for a sub (or block)
in thread Builtin Watchdog for a sub (or block)

While Parrot may make some of that pain easier to deal with (alarm, for example, though it's got issues anyway once you're running with threads) I don't think you're going to see fork or alarm or whatever go away, and honestly I don't think they should. (And my platform of choice--VMS--doesn't fork, amongst other things)

It's kind of silly to neuter things so you get a lowest-common-denominator system. Making perl platform independent by taking things away just hurts the people who're on platforms where it does work. (And fork is really unlikely to be completely emulated on Windows, or any other non-unix platform)

  • Comment on Re: (Ask Perl 6: Win32) Re: Re: Re: Builtin Watchdog for a sub (or block)

Replies are listed 'Best First'.
Re: Re: (Ask Perl 6: Win32) Re: Re: Re: Builtin Watchdog for a sub (or block)
by osfameron (Hermit) on May 14, 2002 at 21:03 UTC
    Elian++, I agree actually, I don't want to see fork and alarm go away. I want to see them working on Win32 (and VMS, and MacOS for that matter), even if they only work because they are emulated by the virtual machine on those platforms.

    Having said that, if there could be a way of achieving the functionality without using specific OS calls, that would be 'better', wouldn't it? (in the sense that it would be more portable, therefore a wider base of happy Perl users)

    And if it really can't be done, I want to see the documentation for tasks that use these functions give Win32 equivalents or just admit that it can't be done in Win32. I find it very frustrating following code from a textbook or standard document only to find that it doesn't work (or works buggily). (Yes, you could say that someone could submit patches for documentation: maybe, though this would require some life-priority task realignment...)

    Cheerio!
    Osfameron
    http://osfameron.perlmonk.org/chickenman

      Fork won't work right 100% of the time on windows (or VMS, or MacOS, though it will on OS X) ever. It can't, and there's a limit to how hard it's worth trying. This is documented in the perlfork section of the manual, though whether you'd think to look for it is another matter entirely.

      Whether alarm works on windows is up in the air. Whether it does depends on whether windows has interruptable system calls, which is the big place it's useful.

      Perl has system-dependent behavior, and it's never claimed otherwise. A fair amount of stuff--pretty much everything feasable--is emulated in places where the base functionality's not native, but there's no 100% guarantee. That's not going to change, nor should it. Because of that, it's always a good idea to check the assumptions behind anything you read before trusting them implicitly. (A good rule of thumb generally)