dart-mutex icon indicating copy to clipboard operation
dart-mutex copied to clipboard

Do mutexes work across isolates?

Open RickPoleshuck opened this issue 2 years ago • 1 comments

The documentation should be changed to answer this question.?

RickPoleshuck avatar Jun 13 '22 19:06 RickPoleshuck

Ok, I'll consider adding a note about it in the next release.

But if you try to use a mutex across isolates, you should quickly realise it is impossible. The only way to communicate between isolates is to use the Isolate.send() method that only sends messages, so there is no way to refer to the same mutex in two different isolates. And the isolates documentation says they are designed so you don't have to worry about mutexes or locks.

hoylen avatar Jun 13 '22 22:06 hoylen