[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] Newbie - don't quite understand tagging method

From: Mark Thomas
Subject: Re: [Gnu-arch-users] Newbie - don't quite understand tagging method
Date: Fri, 28 Nov 2003 10:21:03 +0000 (GMT)

> >> echo "# arch-tag: `uuidgen`" >>
> >
> >It is probably okay, but for the paranoids, it is better to use
> >something you KNOW is going to be unique. It feels uncomfortable
> to rely
> >on random numbers to be unique...
> >
> >echo "#arch-tag: `tla my-id --uid` - `date -u '+%F %T %N'`" >>
> >
> >But you probably already know that.
> Give me one reason to believe your algorithm is more unique than
> mine.  One.

It's not. It's potentially less unique.

On a symmetric-multiprocessing machine running your script many times in
parallel, it's possible for two instances of 'date' to be exec'd
simultaneously and get the same time (the kernel rarely has nano-second
precision: mine has microsecond precision, as far as I can tell).  So the
probability of a collision between two processes running within a 1ms gap
is 1 in 1000 (for my kernel, at least).

It's not impossible: I have actually had this happen to me for something
entirely unrelated in the past (generating pseudo-random seeds from the
clock and the MAC address).

Adding the process id might help :)

I think another discussion a few months ago mentioned that uuids were
useful as arch ids as they didn't look like "last-edited" timestamps that
another non-arch-using developer might want to update.


|| Mark Thomas
|| My train of thought derailed.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]