On Apr 16, 8:17 pm, "Sabiyur" <SabiyurRah...@ gmail.comwrote:
I am working on Windows platform.
Is there any way to find out whether the given process running?
( History: I am using WaitForSingleOb ject. People advised me the
WaitForSingleOb ject could hang if the process for which we are waiting
terminated earlier to calling WaitForSingleOb ject. So I am trying to
check whether the given process is running)
It depends on the system; Posix's waitpid(), for example, has a
WNOHANG option which effectively prevents blocking. On some
systems, you can set a timeout on the process wait, and setting
it to 0 effectively means to poll; this is the case for Window's
WaitForSingleOb ject, for example.
Otherwise, the classical solution is to spawn a separate thread,
and wait there.
--
James Kanze (GABI Software) email:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34