0
0
Operating Systemsknowledge~10 mins

Process states (new, ready, running, waiting, terminated) 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 initial state of a process.

Operating Systems
process_state = "[1]"  # The state when a process is first created
Drag options to blanks, or click blank then click option'
Anew
Bready
Crunning
Dwaiting
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing 'ready' with the initial state.
Choosing 'running' as the first state.
2fill in blank
medium

Complete the code to represent the state when a process is waiting for CPU time.

Operating Systems
process_state = "[1]"  # The state when a process is ready to run but waiting for CPU
Drag options to blanks, or click blank then click option'
Awaiting
Bready
Cterminated
Dnew
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'waiting' which means waiting for I/O, not CPU.
Selecting 'terminated' which means the process has finished.
3fill in blank
hard

Fix the error in the code to show the state when a process is actively executing instructions.

Operating Systems
process_state = "[1]"  # The state when the process is currently using the CPU
Drag options to blanks, or click blank then click option'
Anew
Bready
Cwaiting
Drunning
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'ready' which means waiting to run, not running.
Selecting 'waiting' which means waiting for I/O.
4fill in blank
hard

Fill both blanks to represent the state when a process is waiting for an event and the state when it has finished execution.

Operating Systems
if event_not_occurred:
    process_state = "[1]"
else:
    process_state = "[2]"
Drag options to blanks, or click blank then click option'
Awaiting
Bterminated
Crunning
Dready
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up 'ready' and 'waiting' states.
Confusing 'running' with 'terminated'.
5fill in blank
hard

Fill all three blanks to create a dictionary mapping process states to their descriptions.

Operating Systems
process_states = {
    "new": "[1]",
    "ready": "[2]",
    "terminated": "[3]"
}
Drag options to blanks, or click blank then click option'
AProcess is created but not ready
BProcess is prepared to run
CProcess has finished execution
DProcess is waiting for CPU
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing 'ready' with 'waiting'.
Mixing descriptions of 'new' and 'terminated'.