Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^2: Implementing signals for Win32 Perl using named pipesby BrowserUk (Patriarch) |
on Mar 11, 2008 at 13:50 UTC ( [id://673500]=note: print w/replies, xml ) | Need Help?? |
PIDs can get reused at once on Windows. Really? On my system I cannot get a pid to be reused with anything less that 2632 intervening process starts. Indeed, it is always 2632 intervening starts on my system, which maybe indicative of some flaw in my test method. But still, I think the quoted statement is suspect also?
Using a TID rather than a PID may resolve them, and make the race condition less likely, but still not impossible. Thread ids are simple incrementing numbers starting from 1 in each process, and would be more (very) likely to be repeated. I'm not at all certain that there is a potential race condition. If the process with the pid creates its own named pipe, then when the process terminates for any reason, that named pipe will cease to exist before the process is finally cleared from memory. The system won't allow that to happen until all open handles have been destroyed. And it won't allow the reuse of a pid until the old process has been properly cleaned from the internal tables. Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
In Section
Seekers of Perl Wisdom
|
|