Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Asynchronous unique ID generation.


You can have both asynchrony and sequence by encoding thread ID in the UUID too, and make the sequence a thread local state.



Then, just use thread ID and integer sequence pairs instead of trying to stuff them into an arbitrary binary format.


Thread IDs get repeated across reboots. Integer sequence may also repeat in a distributed scenario, unless you want a massive bottleneck. You do need other stuff (timestamps, random number, etc.).


Yes, but that’s what parent proposed? :shrug:




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: