in reply to Re: writing to logfile in a loop
in thread writing to logfile in a loop

I believe Task Manager just sends a SIGTERM.

There's no such thing as signals in Windows. The closest parallel is the message queues of windows.

Furthermore, Task Manager's behaviour varies depending on which tab ("Applications" or "Processes") the item being terminated is located.

When "ending" a "Process", the application is forcibly terminated. ( Reference: TerminateProcess(hProcess, uExitCode) )

When "ending" an "Application", it sends a WM_QUIT WM_CLOSE message to the window. If the application is still running after a small period of time, the user is told the process is not responding, and he is asked whether he wants to terminate the process or not. If the user chooses to terminate the process, it is forcibly terminated. ( Reference: EndTask(hWnd, FALSE, TRUE) )

Replies are listed 'Best First'.
Re^3: writing to logfile in a loop
by wojtyk (Friar) on Nov 24, 2006 at 17:09 UTC
    Is Perl capable of handling Windows messaging? I know that if you were writing a Windows app, you could just have a message loop and handle the WM_CLOSE message.
      All Windows can (and must) handle Windows messages. If your Perl app has a window (using Tk, wxPerl, or whatever), then yes. Unfortunately, most Perl scripts don't have a window. (The console doesn't count because Perl doesn't manage that window.)