See
https://github.com/JuliaLang/julia/issues/5622 and
https://github.com/JuliaLang/julia/issues/7176

If you are on Windows, LockFileEx is reliable and you could ccall it
yourself. Probably simpler to handle the problem at a higher level for now
though (i.e. run one script that checks installation *before* launching
your analysis jobs).


On Wed, Jul 6, 2016 at 5:09 PM, David Anthoff <[email protected]> wrote:

> Hi,
>
>
>
> I have a script that is using some packages. The script is set up such
> that if the package it is trying to use is not installed, it will do a
> ``Pkg.add`` to add the package before ``using`` it.
>
>
>
> This script is triggered by a third process, and it might be triggered
> multiple times simultaneously, i.e. multiple instances of julia might run
> the same script at the same time. Therefore the second julia instance might
> issue the same ``Pkg.add`` command as the first instance, while the first
> instance is not done with the ``Pkg.add`` yet.
>
>
>
> I assume the package manager per se is not set up to handle that situation
> gracefully?
>
>
>
> If not, is there some package that allows me to have something like a
> mutex/lock between my julia processes, so that I can guard the code section
> that fiddles with packages and make sure only one julia instance at a time
> runs that code?
>
>
>
> Thanks,
>
> David
>
>
>
> --
>
> David Anthoff
>
> University of California, Berkeley
>
>
>
> http://www.david-anthoff.com
>
>
>

Reply via email to