30 ms·
I guess for the particular use case the simple string hash works. In the worst case you lock a few more likely unrelated users. However, in some cases you want
by quelltext 5y ago
I guess for the particular use case the simple string hash works. In the worst case you lock a few more likely unrelated users.
However, in some cases you want to enact a specific locking order on some objects that interact, and in particular if locks aren't reentrant, I'd be cautious and at least use a cryptographic hash here to reduce likelihood if collisions.