Back to the 2019 paper

Module 3: Inter-process Communication

201914m

What do you understand by race condition?

Give few example of arising of race condition in concurrent processing.

Worked SolutionAI Assisted

Race Condition

Occurs when multiple processes/threads access shared data concurrently and outcome depends on order of execution.
Example: shared counter x=5, P1: x=x+1, P2: x=x-1 interleaved without sync can give wrong result. Other examples: lost update in database, inconsistent file write, printer spooler with two producers updating buffer indices.
Requires mutual exclusion, atomic operations.

Similar questions

Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.