I don't wish to be a wet blanket on what, to me, seems like a neat idea (but I will anyway).

Using the PID for the name of a pipe could give a race condition: rare, but possible. Senario:
1. Process A wants to send a signal to Process B, so opens the pipe.(CreateFile).
2. Process B ends.
3. Process C starts with the same PID as Process B. PIDs can get reused at once on Windows.
4. Process A sends the signal, but to C instead of B.

A "linger" mechanism is required, or maybe some other identifier to be passed down the pipe? At least the process can detect if the pipe already exists before creating it, but the possibility of a race still exists in the period between Process A getting the PID and actually sending the signal.

There are also issues to be thought through with threads, particularly considering the implementation of fork. Using a TID rather than a PID may resolve them, and make the race condition less likely, but still not impossible. Update: What would be really good is an implementation of waitid() with siginfo_t fully supported.

In reply to Re: Implementing signals for Win32 Perl using named pipes by cdarke
in thread Implementing signals for Win32 Perl using named pipes by Corion

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.