Member-only story

What is Deadlock in Programming

Programming theory

Steven Curtis
5 min readMay 24, 2022
Photo by Denys Nevozhai on Unsplash

A deadlock is a classic problem in Computer Science.

In some sense during the early days of computing Deadlock was mitigated as a problem somewhat as they would only run one program at a time, so any given program would be able to manage it’s own resources and be sure that they are available when required.

Modern machines tend to have sophisticated Operating Systems that manage resources for programs which can then run in the same time-space.

There is a difficulty in programming though: You can end up with a Deadlock situation if you do not take proper care of your resources.

Terminology

Sync dispatching: means that the thread where the task is dispatched has to pause and finish executing the task before resuming.
Async dispatching: means that the thread can be dispatched and does not wait for the task to finish executing.
Preemption: Temporarily interrupting a task with the intention of resuming it at a later time.

--

--

No responses yet