I’m curious about what happens when @jit/@njit functions are called from multiple processes or threads. Does each process JIT the function separately? Is the answer the same in threading? Further, if cache=True, is the cache thread-safe? Finally, is it a good idea to AOT compile functions which will be run in parallel contexts? I wasn’t able to find much info about this topic and would appreciate any pointers, thanks!
The docs seem to indicate that sharing cache among processes on a machine is safe and cache on a network drive may be safe if the protocol meets the defined conditions. Perhaps I’ve misunderstood them. At any rate, I’ve never had trouble with multiple processes sharing a cache.
1 Like