in reply to Re^6: waitpid returns -1 for still running child (Windows)
in thread waitpid returns -1 for still running child (Windows)

Could it be that there is some time gap between system(1,...) returning to the caller, and the child process being entered in the Windows process table?

Um. I think not. For a definitive answer you would probably have to ask Dave, but as system pretty much translates into a simple call to CreateProcess(), it is hard to see how that would return to the caller before the created process existed within the system tables.

However, it is conceivable that on a very heavily loaded system, that the process of creating a process, meant that the creating process overstayed its time slice, and so as soon as that calling process transitioned back from ring 0 to ring 3, it was immediately context switched, and did not get another time slice for 2 seconds. If sufficient other processes had become eligaible to run in the interim. But 8 seconds?

That said. I have on occasion run a perl process to explore the limits of my system--for example, by requesting the allocation of a single 10 GB scalar (I only have 4GB of physical memory), and then got up and made myself a cup'o'char. On my return, if the system is still running like a dog, I've resorted to killing the process.

Now, like Mr. Tipton grits, some things just take as long as they take. And unless you bought magic grits from the beanstalk salesman, you're just gonna have to wait till they're ready.


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.
RIP an inspiration; A true Folk's Guy