Techniques for assuring thread rendezvous for a plurality of threads
executing in a computing system are disclosed. Techniques can be used to
assure thread rendezvous for read-only code in a manner that is more
efficient than polling techniques. A Light-weight, Yet Trappable On
Demand (LYTOD) instruction can be generated for code that is executed by
one or more threads. Typically, a LYTOD instruction is generated at
critical points of the code in order to assure safe-point thread
rendezvous. The LYTOD is a lightweight instruction that can change its
behavior from a lightweight instruction to an instruction that causes a
trap when executed. The LYTOD can, for example, be implemented as a
read-from-memory instruction that operates to load a register with a
content of a valid memory location.