3 ms·
I mean the answer here is an async getBalance and setBalance is the incorrect way to do this, and a mutex won't solve that. if balance is a javascript variable
by Arelius 7y ago
I mean the answer here is an async getBalance and setBalance is the incorrect way to do this, and a mutex won't solve that.
if balance is a javascript variable, access shouldn't be provided by async functions. In the case that mutex is a remote resource of some sort (file or network resource) a process local lock won't solve this for you either.
It seems to me that the lack of locks make forces software engineers to consider the nature of their data instead of just grabbing for the inappropriate os lock.