Executing programs coded in an instruction set of a first computer on a
computer of a second, different architecture. An operating system
maintains an association between each one of a set of concurrent threads
and a set of computer resources of the thread's context. Without
modifying a pre-existing operating system of the computer, an entry
exception is establishing to be raised on each entry to the operating
system at a specified entry point or on a specified condition. The entry
exception has an associated entry handler programmed to save a context of
an interrupted thread and modify the thread context before delivering the
modified context to the operating system. A resumption exception is
established to be raised on each resumption from the operating system
complementary to one of the specified entries. The resumption exception
has an associated exit handler programmed to restore the context saved by
a corresponding execution of the entry handler. The entry exception, exit
exception, entry handler, and exit handler are cooperatively designed to
maintain an association between a one of the threads and an extended
context of the thread through a context change induced by the operating
system, the extended context including resources of the computer
associated with the thread beyond those resources whose association with
the thread is maintained by the operating system.