I have an @everywhere function that I’m running in pmap, which works well except for the occasional glitch. I have a theory that said glitch is related to an I/O issue when multiple processes try to read/write files at the same time. (The exact nature of the glitch is not important at this juncture).
To try to isolate this I want to mutex the read/write functions to ensure that only one process can do I/O stuff at any given time. Is this possible with pmap? I tried creating a global SpinLock, but of course the individual processes don’t have access to it.
What’s the appropriate way to do this?