I understand that Race condition: is when multiple processes (or threads) read and write data items so that the final result depends on the order of execution in the multiple processes. By my question is Does the existence of a race condition in the code imply the existence of an execution sequence that will result in a deadlock?

1

There are 1 best solutions below

0
On BEST ANSWER

No.

A race condition means that depending on execution order, different final results can be observed.

Note: this definition doesn't imply at all that any kind of locking happens at all. No locking, no deadlocks. It is as simple as that.

Of course: it is possible that locking is involved; and sometimes you end up with invalid results; and sometimes you end up in a deadlock. But the important thing, as said: it is possible, just not in all cases.