in reply to signal handler on NT

From the ActiveState documentation for Perl 5.6.1

Why doesn't signal handling work on Windows? Signals are unsupported by the Win32 API. The C Runtime provides crude + support for signals, but there are serious caveats, such as inabilit +y to die() or exit() from a signal handler. Perl itself does not guar +antee that signal handlers will not interrupt critical operations suc +h as memory allocation, which means signal invocation may throw perl +internals into disarray. For these reasons, signals are unsupported a +t this time.

Cor! Like yer ring! ... HALO dammit! ... 'Ave it yer way! Hal-lo, Mister la-de-da. ... Like yer ring!

Replies are listed 'Best First'.
Re: Re: signal handler on NT
by kabel (Chaplain) on Sep 17, 2002 at 21:02 UTC
    i can't see the need to "implement" the unix signal handlers on the win32 platform. asynchronous messages are AFAIK "events", so why not use this mechanism?
    (x) yes, i am probably writing nonsense ;)

      Note: I wasn't asking for them, just passing along some relevent information that might help the original poster.

      However, I think the answer to your question is cross-systems compatability. I agree that the Win32 event model is very powerful and useful, but it only works on Win32.

      The unix style signals are implemented pretty much everywhere else, and whilst (IMHO) the are less powerful, they are a) ubiquitous. b) there are many, many algorithms and a wide codebase of applications that use them to good effect. So, unless and until the Unix world adopts the Win32 event model, (and hell will freeze over before they do:), having signals available on Win32 is the pragmatic solution to portability for cross-platform event driven programming.

      It seems however that as with many of the cross-compatibility features implemented in Win32, it is little more than bullet-point programming. Which is to say, it was only included, and only barely implemented in order that it could be listed on presentation slides when MS salesfolk where trying to sell it into large corporate accounts.

      Yes, of course we can take your existing legacy applications and run them on our platform. Look here at this slide showing all the compatibility points.

      {Chairmen of the board ticks box on a 7 line distillation of the 20,000 line report authored by the IT department as to why moving to Win32 would be a major headache>}


      Cor! Like yer ring! ... HALO dammit! ... 'Ave it yer way! Hal-lo, Mister la-de-da. ... Like yer ring!
        that makes me wonder if it would be a good point to abstract the very different asynchronous message passing implementations from the operating systems in such a way a perl programmer is not bound to one os. that seems quite an impossible task to me.

        i stop thinking here, i got no real knowledge about that.