←back to thread

60 points fanf2 | 1 comments | | HN request time: 0.282s | source
Show context
semiquaver ◴[] No.46182699[source]
Don’t skip the discussion on advisory locks. In my experience nearly every nontrivial application that spans multiple machines has concurrency bugs that advisory locks are perfectly suited to fix.
replies(4): >>46183073 #>>46183165 #>>46183758 #>>46183971 #
1. GeertJohan ◴[] No.46183165[source]
They are great, although I wouldnt use the articles advice on using hashtext to get a number for the lock. This may cause collisions, especially when used with a large number of locks.

In a project Im working on we have a single go package that holds a list of all advisory lock numbers as constants.