waitrsv

Wait for Reservation Loss

waitrsv

Waits until a reservation is lost (Multithreading sync).

Details

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.

Pseudocode 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.

Example

waitrsv

Encoding

Binary Layout
31
0
0
6
0
11
0
16
62
21
/
31
 
Format X-form
Opcode 0x7C00003C
Extension Base

Operands