Consider this example -
class Test
@@store = ""
end
Here store is a class variable of Test
and can be mutated from anywhere.
Suppose i am runing my program in multi thread mode & so variable store can be mutated from multiple thread at a time.
My question is - will deadlock arise or crystal-lang handles it in some way due to fiber scheduling ?
If deadlock arises what is the recommended way to solve above program. If you can provide a code from this problem, that would be better.