I am trying to encode a cache in python 3 and I want to avoid concurrency problems for both threads and processes.
I used threading for thread safe code and multiprocessing for process security.
threading
multiprocessing
I can solve my problem using Lock from threading and Lock from multiprocessing at the same time. But I was wondering if there is a βcommonβ Lock for this or something like that.
Thank you in advance, -)
You cannot use the same class for locks in a process, or for locks of cross processes. The implementations are quite different.
Your current strategy is correct.