Instructions
TheInstructions object defines all instruction types supported by the simulator. Each instruction type represents an atomic operation that a thread can perform.
Instruction Types
All instruction types are exported as string constants:Instruction Categories
Mutex Instructions
ACQUIRE - Attempt to acquire mutex
ACQUIRE - Attempt to acquire mutex
RELEASE - Release mutex
RELEASE - Release mutex
Bank Account Instructions
WITHDRAW - Withdraw money
WITHDRAW - Withdraw money
DEPOSIT - Deposit money
DEPOSIT - Deposit money
Semaphore Instructions
WAIT_SEM - Wait on semaphore
WAIT_SEM - Wait on semaphore
PRINT - Print pages
PRINT - Print pages
SIGNAL_SEM - Signal semaphore
SIGNAL_SEM - Signal semaphore
Condition Variable Instructions
WAIT_FOOD - Wait for food
WAIT_FOOD - Wait for food
EAT_FOOD - Eat food
EAT_FOOD - Eat food
COOK_DISH - Cook dish
COOK_DISH - Cook dish
SIGNAL_FOOD - Signal food ready
SIGNAL_FOOD - Signal food ready
Monitor Instructions
ENTER_READ - Enter as reader
ENTER_READ - Enter as reader
READ_BOOK - Read from catalog
READ_BOOK - Read from catalog
EXIT_READ - Exit as reader
EXIT_READ - Exit as reader
ENTER_WRITE - Enter as writer
ENTER_WRITE - Enter as writer
UPDATE_CATALOG - Update catalog
UPDATE_CATALOG - Update catalog
EXIT_WRITE - Exit as writer
EXIT_WRITE - Exit as writer
Barrier Instructions
RUN_STAGE - Run race stage
RUN_STAGE - Run race stage
BARRIER_WAIT - Wait at barrier
BARRIER_WAIT - Wait at barrier
Join/Await Instructions
BUILD_STAGE - Build construction stage
BUILD_STAGE - Build construction stage
JOIN_THREAD - Join on single thread
JOIN_THREAD - Join on single thread
AWAIT_ALL - Await multiple threads
AWAIT_ALL - Await multiple threads
COMPLETE_HOUSE - Complete house
COMPLETE_HOUSE - Complete house
Peterson’s Algorithm Instructions
PETERSON_LOCK - Lock with Peterson
PETERSON_LOCK - Lock with Peterson
USE_STATION - Use robot station
USE_STATION - Use robot station
PETERSON_UNLOCK - Unlock with Peterson
PETERSON_UNLOCK - Unlock with Peterson
Control Flow Instructions
END - End thread execution
END - End thread execution