Member-only story

The Readers-Writers Problem

Deadlocked!

Steven Curtis
3 min readMay 21, 2023
Photo by Andraz Lazic on Unsplash

At the same time? Concurrency?

Threads contain processes and run concurrently. Concurrency means that two tasks can start, run and complete in overlapping time periods. Parallelism is about performing work at the same time.

Concurrency
parallelism

Time slicing can enable *concurrency* if only one thread or core is available, or *concurrency* could benefit from parallelism. Software needs to work concurrently with other task (for example system tasks, or multitasking Apps) whether it truly works in parallel or not.

If tasks did not support concurrency they could not be stopped and restarted, which might be a rather large problem for computers that run web browsers (or have applications that make several API calls).

At the same time? A disaster

What if we have a constraint on a resource — something like a disk. So we want to access this disk as we run processes in parallel (perhaps through several…

--

--

No responses yet