Wow, I was wondering the same thing. And creating files seems to be a great idea. Perhaps these files could be stored on a ramdisk where they are easily accessed and flushed each time the computer is restarted. | [reply] |
The Anon Monk's idea is reasonable for a small number. No, these files aren't stored on RAM disk. They are static and do not change. I would create these files with 0 bytes with the number of files equal to the number of max running processes. The file lock is an O/S concept, not part of the stored file system. A "lock" or "unlock" makes no difference upon the disk storage. All locks get released if the OS reboots because the locks are in memory, not on the hard drive. Something to consider is whether your lock gets released (or not) if your process exits without explicitly releasing it.
| [reply] |
Wow, it is a fresh idea!!!
Just to confirm (i don't know yet) - if process will die becasue of some errors - the lock wil lbe removed by OS? | [reply] |
I would think so, too. However, there's the possibility of a "defunct" process (Unix calls this a Zombie process). If these occur seldom enough, you might ignore the situation (or solve it manually when it occurs).
| [reply] |
This is the kind of crappy kludg I came up with when I was a novice programmer, too.
| [reply] |