0
0
Operating Systemsknowledge~10 mins

Race condition problem in Operating Systems - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to identify the shared resource in a race condition scenario.

Operating Systems
shared_variable = [1]
Drag options to blanks, or click blank then click option'
Athread
Bcounter
Clock
Dprocess
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'thread' or 'process' which are entities, not resources.
2fill in blank
medium

Complete the sentence to explain what causes a race condition.

Operating Systems
A race condition occurs when multiple threads [1] a shared resource without proper synchronization.
Drag options to blanks, or click blank then click option'
Aaccess
Block
Ccreate
Dterminate
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'lock' which is a solution, not the cause.
3fill in blank
hard

Fix the error in the statement about race conditions.

Operating Systems
Race conditions happen when threads [1] a resource sequentially without synchronization.
Drag options to blanks, or click blank then click option'
Aaccess concurrently
Block
Cterminate
Daccess
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'access' which implies any access, not necessarily concurrent.
4fill in blank
hard

Fill both blanks to complete the code snippet that prevents race conditions using locks.

Operating Systems
lock = [1]()
lock.[2]()
# critical section code
lock.release()
Drag options to blanks, or click blank then click option'
ALock
Bacquire
Cstart
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'start' or 'run' which are unrelated to locking.
5fill in blank
hard

Fill all three blanks to complete the explanation of race condition consequences.

Operating Systems
If threads [1] a shared resource [2] synchronization, it can lead to [3] results.
Drag options to blanks, or click blank then click option'
Aaccess
Bwithout
Cunexpected
Dcreate
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'create' which does not fit the context.