On Tue, Jun 24, 2008 at 07:23:51PM -0700, S'orlok Reaves wrote: > > Hmm.... just thought of this: > For the current process ID, you could create a file > called, say, 3455.pid in the temp directory. Make it 1 > byte, and RE-create it every 10 seconds. I don't think > this is too intensive... and it gives you PID > identification accurate to 10 seconds.
I was about to say "why the heck would you do this, since the PID never changes in the life of the program" but now I realize you are really talking about updating the timestamp on the pid file > ...Or is the problem that people are opening custom > twice _at the same time_? In that case, if 3455.pid > exists within the timestamp, just stall for 10 seconds > and see if it gets updated. > > Anyways, I only suggest this because it seems to me > that this is the kind of thing users would expect to > be done for them automatically. Totally up to you > guys. So the only benefit I could see to a constantly updating pid file, is that the second instance of custom could guess if the first instance was still running just by looking at the pid file's timestamp, and without any mucking about with string matching in process tables... But I know that if custom crashes, I can have it open again in a heck of a lot less than 10 seconds, so for distinguishing between two-customs-running-at-once vs custom-crashed-last-time I think the timestamp update interval would have to be much faster, maybe every 1 seconds or less. And even then, I think the information might only be reliable enough for selecting a default recovery action, rather than for doing things automatically. I am really curious as to whether or not a frequently updated file would be a performance hit or not. I'm still wary of this idea, but it could also be applied to game.exe for cleanup of orphaned temp files, as described in bug 280 http://rpg.hamsterrepublic.com/bugzilla/show_bug.cgi?id=280 --- James _______________________________________________ Ohrrpgce mailing list [email protected] http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
