Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Regarding what happens if the main thread terminated, I assume that the termination is due to the Perl program stopping. Then, the C function, exit(), in the runtime library (called by Perl when stopping) would use the Win32 ExitProcess() system call and would take down all the process threads including the signal handler thread.

Regarding what happens if there's another SIGHUP, the SIGHUP is actually coming from the control handler code which is triggered by a Win32 CTRL_CLOSE_EVENT. Keep in mind that under later versions of Windows, a single CTRL_CLOSE_EVENT means a process is doomed! Soon, or very soon, it's going down! So even if a second SIGHUP came in and caused a segfault in Perl the only thing that would be lost is a cleanup opportunity that we aren't even taking advantage of right now.

Now, about that second or subsequent SIGHUP. Let's say it does get triggered and the sig_terminate(aTHX_ 1); from win32.c activates the $SIG{ 'HUP' } in the Perl program. I imagine it would have the same effect as any other repeated signal in Perl, that is the effect would depend on the $SIG handler, maybe it segfaults, maybe its ignored, maybe . . ., but it would be the same as in Linux or elsewhere.


In reply to Re^2: The implementation of SIGHUP in Win32 Perl by klaten
in thread The implementation of SIGHUP in Win32 Perl by klaten

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-23 08:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found