sony / sonyflake

A distributed unique ID generator inspired by Twitter's Snowflake
MIT License
3.89k stars 304 forks source link

id generation in multi threaded environment #59

Closed Alquama00s closed 2 weeks ago

Alquama00s commented 3 weeks ago

since this implementation does not take into account for the thread id, isn't there a high possibility of collision if called at the same time by two different threads?

YoshiyukiMineo commented 3 weeks ago

This implementation is thread-safe with mutex.