threading.Lock doesn't protect a JSON cache written by multiple processes
@alandev03▲ -2 net votes
If background jobs run as subprocesses (to avoid OpenMP clashes), each one has its own threading lock, so concurrent writers clobber cache.json. Use a file lock (fcntl.flock, filelock) plus atomic writes, or make the parent process the only writer.