Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The key provided by ftok is notoriously unreliable. Depending on the version, it is and algorithm based on an inode number and a project code.
The inode number is unreliable for several reasons. An inode is only unique within a partition. It is possible that two files on different paritions could have the same inode resulting in ftok returning a non-unique key - unlikely, but possible. Inode numbers change! If a sys. admin. reorganises the partition, maybe just a backup then restore, then inodes are now different. Since message queues are "kernel persistent" (lost on a reboot), and we never reboot UNIX ;-) then programs running will use different keys to any started after the reorg. This has happened to me more than once. So, personally I would not use ftok, but create my own safe algorithm which is repeatable on every occasion. In reply to Re: Key for message queue creation...
by cdarke
|
|