[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Q: How to determine wether a process is still running?
From: Mirko Sucker <mirko.sucker () unibw-hamburg ! de>
Date: 1998-05-08 20:46:10
[Download RAW message or body]
Vadim Zaliva wrote:
> On Fri, 8 May 1998, Uwe Thiem wrote:
>
> > > If somebody needs code which finds system bood time for above platforms,
> > > email me. You will need it for locking.
> >
> > Why? Let's assume system uptime is about 86 days and you find a lockfile
> > 5 hours old. What now? Don't rely on times. A call 'kill(pid, 0 )'
> > is exactly what's necessary.
>
> Let's assume opposite situation. System uptime 5 hours and lockfile 86
> days old. If you just check PID stored in this lock file it might say taht
> such process exists, but this is not the process which created file. In
> general lockfiles older that boot time should be discarded.
>
Thanks for the replies.
I think both conditions need to be checked. But there is still a chance that
the process with the same pid is not the creator of a lockfile.
I heard of mandatory locking of files. Can somebody give some comments if this
is usable here, what has to be considered and what advantages is has?
--Mirko.
--
http://www.hamburg.netsurf.de/~mirko.sucker/
Die besten sind diejenigen, die alles selbst bedenken; gut sind auch die,
die auf den Rat Erfahrener hoeren; diejenigen aber, die weder wissen noch
hoeren auf anderer Weisheit sind nutzlose Wichte. --Hesiod (8. Jhd. v.C.)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic