← Back to team overview

acmeattic-devel team mailing list archive

Client Side Architecture - Race Condition

 

Hi *,
In the proposed client architecture, the client and daemon independently
communicate to the server through the core client code (the client library).
To resolve the race condition we can maintain a data structure say,
File_Operation_State.
Initially, this data structure will be empty. When a client or daemon needs
to communicate with the server it can insert the query in the form of a
key-value pair. The key will be the file name and the value will be the
"STATE_OF_THE_OPERATION". The client and daemon has to initially query and
check for the current state of the file being operated. The client or the
daemon cannot perform the desired operation if the file is operated by the
other application. Also, the key-value pair needs to be removed from the
data structure once the application had finished their respective operation
on the file. Now, we have to ensure the thread safety of this data
structure. I am not entirely sure about the locking mechanism that needs to
be used to ensure the thread safety for this structure. Need to think about
the same.
Cheers,
pbs

Follow ups