Asynchronous System Trap

Asynchronous System Trap

Asynchronous system trap (AST) refers to a mechanism used in several computer operating systems designed by the former Digital Equipment Corporation (DEC) of Maynard, Massachusetts.

Various events within these systems can be optionally signalled back to the user processes via the AST mechanism. These ASTs act like subroutine calls but they are delivered "asynchronously", that is, without any regard to the context of the main thread. Because of this, care must be taken:
* to ensure that any code that is shared between the main thread and the AST must be designed to be reentrant, and
* any data that is shared must be safe against corruption if modified at any time by the AST. Otherwise, the data must be guarded by blocking ASTs during critical sections.

ASTs are most commonly encountered as a result of issuing QIO calls to the kernel. Completion of the I/O can be signalled by the issuance of an AST to the calling process/task. Certain runtime errors could also be signalled using the AST mechanism. Within VMS, Special Kernel-Mode ASTs are used as the standard mechanism for getting access a process context; they are executed at the highest possible per-process priority the next time the scheduler makes that process current, and are used among other things for retrieving process-level information (in response to a $GETJPI "getjob/process information" system call) and for performing process deletion.

The following operating systems implemented ASTs:
* RSX-11 (including all of the variants)
* RSTS/E
* VMS

ASTs are roughly analogous to Unix signals. The important differences are:
* There are no "signal codes" assigned to ASTs: instead of assigning a handler to a signal code and raising that code, the AST is specified directly by its address. This allows any number of ASTs to be pending at once (subject to process quotas).
* ASTs never abort any system call in progress. In fact, it is possible for a process to put itself into a "hibernate" state (with the $HIBER system call) where it does nothing but wait for ASTs to be delivered; when an AST is delivered, the process is temporarily woken up, and after the AST completes, the process goes right back into hibernation again. The only way to get out of this state (apart from process deletion) is to execute the $WAKE system call; this can be done by an AST within that process, or by another suitably-privileged process.

VAX/VMS V4 and later implemented an interesting optimization to the problem of synchronizing between AST-level and non-AST-level code. A system service named $SETAST could be used to disable or enable the delivery of ASTs for the current and all less-privileged "access modes" (the VMS term for ring-based security features). However, if the critical section needing protection from ASTs was only a few instructions long, then the overhead of making the $SETAST calls could far outweigh the time to execute those instructions.

So for user mode only (the least privileged ring, normally used by ordinary user programs), a pair of bit flags was provided at a predefined user-writable memory location (in per-process "P1" space). The meanings of these two flags could be construed as "don't deliver any ASTs" and "ASTs have been disabled". Instead of the usual pair of $SETAST calls, the user-mode code would set the first flag before executing the sequence of instructions during which ASTs need to be blocked, and clear it after the sequence. "Then" (note the ordering here, to avoid race conditions) it would check the second flag to see if it had become set during this time: if so, then ASTs really have become disabled, and $SETAST should be called to re-enable them. In the most common case, no ASTs would have become pending during this time, so there would be no need to call $SETAST at all.

The kernel AST delivery code, for its part, would check the first flag before trying to deliver a user-mode AST; if it was set, then it would directly set the ASTs-disabled bit in the process control block (the same bit that would be set by an explicit $SETAST call from user mode), and also set the second flag, before returning and leaving the AST undelivered.

See also

* Signal (computing)


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Trap (computing) — Kernel trap redirects here. For the website, see KernelTrap. In computing and operating systems, a trap, also known as an exception or a fault, is typically[NB 1][1] a type of synchronous interrupt typically caused by an exceptional condition… …   Wikipedia

  • Spring (operating system) — Spring was an experimental microkernel based object oriented operating system developed at Sun Microsystems in the early 1990s. Using technology substantially similar to concepts developed in the Mach kernel, Spring concentrated on providing a… …   Wikipedia

  • AST — • Asynchronous System Trap • Atlantic Standard Time • Advanced Simulation Technology ( > IEEE Standard Dictionary ) • Astrometry Science Team Astronomie • Asymetrical Stacked Trench • Albert, Safi & Tom: AST Research, Inc. • Applied System… …   Acronyms

  • PCLSRing — (also known as PC Lusering) is the term used in the ITS operating system for a consistency principle in the way one process accesses the state of another process. Contents 1 Problem scenario 1.1 ITS solution: transparent restart 1.2 Unix solution …   Wikipedia

  • RSTS/E — Infobox OS name = RSTS caption = Example text display via remote connection. developer = Digital Equipment Corporation (now owned by Mentec Inc.) source model = Closed Source kernel type = Time sharing operating systems supported platforms = PDP… …   Wikipedia

  • OpenVMS — New logo Old logo OpenVMS V7.3 1 run …   Wikipedia

  • QIO — (Queue I/O) is a term used in several computer operating systems designed by the former Digital Equipment Corporation (DEC) of Maynard, Massachusetts.I/O operations on these systems are initiated by issuing a QIO call to the kernel. The call… …   Wikipedia

  • AST — [1] Asynchronous System Trap [2] Atlantic Standard Time [3] Advanced Simulation Technology ( > IEEE Standard Dictionary ) [4] Astrometry Science Team {Astronomie} [5] Asymetrical Stacked Trench [6] Albert, Safi & Tom: AST Research, Inc. [7]… …   Acronyms von A bis Z

  • AST — is a three letter abbreviation that stands for a number of different things.;In science and technology * Aspartate transaminase, an enzyme associated with liver parenchymal cells * Abstract syntax tree, a finite, labeled, directed tree used in… …   Wikipedia

  • Ast (Begriffsklärung) — Ast bezeichnet: Ast, Teil der Wuchsform des Baumes Ast (Heraldik), ein Heroldsbild in der Heraldik Ast (Aßling), Ortsteil der Gemeinde Aßling, Landkreis Ebersberg, Bayern Ast (Feldkirchen Westerham), Ortsteil der Gemeinde Feldkirchen Westerham,… …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”