hypothesis on why dealing with insufficient software documentation has gotten a lot more agonizing over the last few years: you don't find the personal developer blog's post complementing it in your web search any more
@c3manu I love the „small web“ search modifier for Kagi for this, it actually seems to work-ish most of the time-ish (that’s probably the best we can get these days)
@c3manu I relate to that but also, what else am I gonna do? I need search, it’s not something I can miss, it’s essential to my work etc. I wish there was another option.
@maralorn@kosmikus im pretty sure that was to replicate the behaviour of the Java version, no? Edsko did talk about examining the size of the critical region being the original motivation behind the Java code.
Using an MVar is using a lock. while the MVar is taken, no other Thread can take it.
@maralorn atomicModifyIORef doesn’t seem to work very well here in particular, mind that we throw an exception in one of the branches. Tbh I think an MVar is the perfect fit here 😅
@maralorn oh, in my mind its a lock which also has a value, locking the MVar is taking it, unlocking it is putting it. Or, if you so wish, you can even do it in reverse.
As far as i understand what you normally call a lock is what we’d call an MVar ().