|
Posted by David Haynes on 02/04/06 21:56
David T. Ashley wrote:
> Hi Guys,
>
> In my application I need a way to generate an identifier that is guaranteed
> to never recur in the lifetime of the server. The method I'm using now is
> to concatentate:
>
> a)Integer time, in seconds,
>
> b)Micro time, in microseconds, and
>
> c)PID
>
> into one string, then to spin-lock or micro_sleep() until the micro_time
> changes.
>
> My assumption is that this identifier will be unique because no two
> processes can have the same PID at the same time.
>
> Is there a better way?
>
> Thanks, Dave.
>
> P.S.--Application: Linux, Apache, PHP, MySQL, web database stuff.
>
>
>
Do a google search for uuid to find the proposal by Microsoft. There are
many Linux implementations of this function.
-david-
Navigation:
[Reply to this message]
|