I am developing an SVN-like system (which basically has input / output / put / get / list / delete commands) that should accept commands from multiple clients. My idea was to put all the received commands in a structure (in the form of a lock), similar to a queue, which would execute them sequentially in another thread.
Later, with more time, I could develop some clever mechanisms to understand if one or more of the following queue messages can be started at the same time, so that I can speed up the process (for example, if both teams that I have on the queue to work over different projects, there are no problems with the state of the race / joint data).
Now I am faced with the question of whether this is really the best solution to the problem. I could just lock the files because I use them, but I am afraid that this may lead to deadlocks in some specific cases (although tbh I still could not imagine a specific case where this could happen) .
This project should be used in the network security class. Thus, this SVN thing is just the basis on which I will later describe the essence of my security issues. I would not consider that performance is of paramount importance (but to avoid deadlocks, YES!), Therefore, the goal is the correctness of the algorithm.
How do you approach this situation?
source share