P is for Practical | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
If you have a RDBMS nearby, delegate the problem to the database. Create a sequence and fetch a value from it for each running instance. Sure, it looks like overkill, but all major RDBMS have solved all of those nasty litte problems (like parallel access from several systems, atomic updates of the sequence value, running on multiple CPUs in parallel, locking ...). Actually, I wonder why you would need that unique ID outside a database. Alexander
-- Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-) In reply to Re: Generate a unique ID
by afoken
|
|