Follow

I see the guy in the Medium article used a mutex. You have to be a bit careful with these because only one thread can hold a mutex at once (until the unlock method is called). Other threads have to wait until it's released.

If you're doing something that takes a long time, that might be painful.

en.wikipedia.org/wiki/Test-and The mutex is likely implemented with some sort of atomic instruction like this.

Olives  
Mastodon's ID format appears to be a custom kind of snowflake (the huge number which appears in the URL for posts). https://en.wikipedia.org/wiki/S...
Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.