0
I am developing an application where I will create a multithreading that will read a file .json
and based on a key from this file (status: 'pending'
or status: 'completed'
) I will perform an action or not.
The idea is that this action will not be executed twice in the same item, so when I finish the action in an item the status will be changed from pending
for completed
. My question is, as the file will be read by several instances of Python at the same time, I can trust that the key will be updated in real time, or I need to reopen the file every time I check if it is necessary to touch that item again?
From what you are describing you will have to ensure this in the code, the language does nothing on its own.
– Maniero