I'm developing an application where I'll create a multithreading that will read a .json
file and based on a key of this file ( status: 'pending'
or status: 'completed'
) I'm going to perform an action or not.
The idea is that this action is not executed twice on the same item, so when I finish the action on an item the status will be changed from pending
to completed
. My question is, since the file will be read by multiple instances of Python at the same time, can I trust that the key will be updated in real time, or do I need to reopen the file every time it checks to see if that item needs to be tampered with again?