Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Server Unique Identifier Question
- David T. Ashley
February 4, 2006, 6:14 pm
rate this thread
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
a)Integer time, in seconds,
b)Micro time, in microseconds, and
into one string, then to spin-lock or micro_sleep() until the micro_time
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?
P.S.--Application: Linux, Apache, PHP, MySQL, web database stuff.
Re: Server Unique Identifier Question
Thanks for that tidbit. I wasn't aware that this was available.
I glean that the approach I'm using and the approach Apache is using is
identical except I use microtime and a spin lock whereas Apache uses a
So, it reinforces my belief that my approach is correct.
I wasn't aware that Apache does this.
- » php lost variable 0 from the form when i try to save it into mysql database - please help
- — Previous thread in » PHP Scripting Forum