waitrsv
Wait for Reservation Loss
waitrsv
Waits until a reservation is lost (Multithreading sync).
Encoding
Binary Layout
31
0:5
0
6:10
0
11:15
0
16:20
62
21:30
/
31
Operands
Related
More in Base
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
Suspends instruction execution until the reservation created by a lwarx/ldarx instruction is lost. This synchronization primitive is used in multi-threaded code to wait for concurrent modifications to shared memory locations. The reservation is typically lost when another processor executes a store to the reserved address or on context switches.
Operation
Wait_until_reservation_is_lost()
Programming Note
Use waitrsv when you need to ensure that a storage location has not been modified by another processor since it was reserved. This instruction is useful in multi-processor environments where data consistency is critical. Ensure that the address is correctly aligned and that the reservation is properly set before using this instruction. If the reservation is lost, the instruction will return true; otherwise, it returns false.