To avoid a race condition when computing in parallel, we should enable a "lock" feature on the cache file. If a lock file is detected, wait until it's removed before reading the cache. We should wrap the cache creation in a try/except block to clean up lock files if there is a failure.