
A
Interlocked Memory Instructions (Alpha Only)
The Alpha Architecture Reference Manual, Third Edition (AARM) describes
strict rules for using interlocked memory instructions. The Alpha 21264
(EV6) processor and all future Alpha processors are more stringent than their
predecessors in their requirement that these rules be followed. As a result, code
that has worked in the past, despite noncompliance, could fail when executed on
systems featuring the 21264 processor and its successors. Occurrences of these
noncompliant code sequences are believed to be rare. Note that the 21264
processor is not supported on versions prior to OpenVMS Alpha Version 7.1-2.
Noncompliant code can result in a loss of synchronization between processors
when interprocessor locks are used, or can result in an infinite loop when an
interlocked sequence always fails. Such behavior has occurred in some code
sequences in programs compiled on old versions of the BLISS compiler, some
versions of the MACRO–32 compiler and the MACRO–64 assembler, and in some
HP C and C++ programs.
The affected code sequences use LDx_L/STx_C instructions, either directly in
assembly language sources or in code generated by a compiler. Applications most
likely to use interlocked instructions are complex, multithreaded applications or
device drivers using highly optimized, hand-crafted locking and synchronization
techniques.
A.1 Required Code Checks
OpenVMS recommends that code that will run on the 21264 processor be checked
for these sequences. Particular attention should be paid to any code that does
interprocess locking, multithreading, or interprocessor communication.
The SRM_CHECK tool has been developed to analyze Alpha executables for
noncompliant code sequences. The tool detects sequences that may fail, reports
any errors, and displays the machine code of the failing sequence.
A.2 Using the Code Analysis Tool (SRM_CHECK)
The SRM_CHECK tool can be found in the following location on the OpenVMS
Alpha Version 7.3-2 Operating System CD:
SYS$SYSTEM:SRM_CHECK.EXE
To run the SRM_CHECK tool, define it as a foreign command (or use the
DCL$PATH mechanism) and invoke it with the name of the image to check. If
a problem is found, the machine code is displayed and some image information
is printed. The following example illustrates how to use the tool to analyze an
image called myimage.exe:
$ define DCL$PATH []
$ srm_check myimage.exe
Interlocked Memory Instructions (Alpha Only) A–1