I have a multithreaded app in which I need to use a global dict to remember and handle requests.
The problem is, I am not supposed to perform the same request twice, so I need dict to be able to test if the key exists. if not, insert it, if it does, report error.
All code runs in python so GIL should not be relevant.
Is that feasible in python?
Here lock would work but I am trying to find a more natural way to solve it.