Trusted by millions of Kenyans
Study resources on Kenyaplex

Get ready-made curriculum aligned revision materials

Exam papers, notes, holiday assignments and topical questions – all aligned to the Kenyan curriculum.

What is a race condition? Give an example

What is a race condition? Give an example

Answers


Faith
When two (or even more) processes try to concurrently access a shared resource, leading to odd
behaviour, deadlocks or mistakenly overwriting memory addresses.
Typical example from lectures: Two processes simultaneously updating a counter (lol, Assignment 1
math.c). Say Process A reads the variable but process B steps in and reads and writes to it. Control is
passed back to process A, who just writes to it. You’ve just written to it twice. Ouch.
Titany answered the question on April 26, 2022 at 05:18

Answer Attachments

Exams With Marking Schemes

Related Questions