Page 2 of 2
This situation is safe, as long as A and B are really independent and given than they remain independent after subsequent changes to the server. If A and B aren't truly independent, we can end up with what is called deadlock, a situation in which the first client has A and also needs B, while the second client has B and also needs A. This is a special case of starvation, in which the client shares responsibility for its own starvation. Note that Oaks and Wong state in Java Threads that "Deadlock ... is the hardest problem to solve in any threaded program."
In summation, thread-safe programming seeks to maximize efficiency by eliminating racing situations, while at the same time avoiding starvation situations.