1.Contract A makes a call to contract B to retrieve a state value from B
2.Contract A then uses the data provided by contract B to create modified value
3.Contract A sends the derived value back to contract B as an updated state
Is it possible for another contract C to call into contract B between step 1 and step 3, potentially changing the state without the knowledge of contract A, while B is effectively idle in between the end of step 1 and the beginning od step 3?
If this is not possible, why not? What provides this security?
If this is possible, I would assume that a Mutex of some kind could be used by A to lock the state of B until step 3 was complete. Is this the best practice for this situation?