Hi all,

If you look closer, osl/process.h appears to be a poorly thought out interface. One you cannot reasonably implement on Unix. Or what am I missing?

Among others, osl/process.h has osl_executeProcess, osl_terminateProcess, and osl_joinProcessWithTimeout.

On Unix, osl_executeProcess obviously needs to initiate the fork(2) (and there obviously needs to be some mapping between the child pid returned by fork and the oslProcess returned by osl_executeProcess).

osl_terminateProcess, to be of any use, needs to send a kill(2) to the child pid. However, it must never do so after a waitpid(2) for that pid has returned successfully.

How, then, do you implement osl_joinProcessWithTimeout? It needs to call waitpid(2). Since there is no "waitpid with timeout" in Unix, it moves the waitpid into an extra thread. But how can osl_terminateProcess and the extra thread do the necessary synchronization?

Can the osl/process.h interface only be implemented correctly with waitpid WNOHANG and polling? POLLING?!? Please tell me I am missing the obvious.

-Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to