Closed calonso closed 11 years ago
Hi!
Without investigating it further, I think the issue is that fork_break uses subprocesses instead of threads. Therefore, the two subprocesses don't see each other mutex at all!
Mutexes are typically used to synchronize shared memory, whereas fork_break is built around the use case where you have several rails processes synchronizing against some shared external resource (such as a database). In those cases you need some sort of "external synchronization" such as database locks.
It might be interesting to modify or extend the library to support threads as well but it might be a bit of work! If you want to give it a shot, go right ahead!
Closing.
Hi.
I'm facing problems when trying to test concurrency with mutexes involved. I don't know if is my fault or some kind of bug, but I really need help.
In my model
In my rspec
And the output is
So the mutex has been violated. I've also checked that the class attribute is shared (the memory address of the object is the same)
Any advice? Thanks