On Wed, Mar 09, 2011 at 01:56:50PM -0500, Wietse Venema wrote: > Perhaps it is time to replace the time-in-microseconds portion of > the queue ID by a sufficient number of random bits.
I would not replace the microsecond time, its monotonicity has useful properties. Rather, we could augment the microsecond time and inode with ~16 additional bits, say cleanup appends to the microsecond encoding, before the inode: (epoch time & 0xff) << 8 | (pid + msg count) & 0xff On a lightly loaded system with a single cleanup doing all the work, the pid + msg count will be locally monotone even if the clock drifts back. While "pid + msg count" collisions will happen on busy systems, the clock should keep repetitions at least 256 seconds apart, but in practice the odds of the microseconds and pid also colliding when the same inode is being re-used are extremely low. -- Viktor.