词条 | Trap (computing) |
释义 |
In computing and operating systems, a trap, also known as an exception or a fault, is typically[1][2] a type of synchronous interrupt caused by an exceptional condition (e.g., breakpoint, division by zero, invalid memory access). A trap usually results in a switch to kernel mode, wherein the operating system performs some action before returning control to the originating process. A trap in a system process is more serious than a trap in a user process, and in some systems is fatal. In some usages, the term trap refers specifically to an interrupt intended to initiate a context switch to a monitor program or debugger.[3] Deriving from this original usage, trap is sometimes used for the mechanism of intercepting normal control flow in some domains.[4] In SNMP, a trap is a type of PDU used to report an alert or other asynchronous event about a managed subsystem. See also
Notes1. ^There is a wide variation in the nomenclature. On some computers the term trap refers to any interrupt, on some machines to any synchronous interrupt, on some machines to any interrupt not associated with input/output, on some machines only to interrupts caused by instructions with trap in their names, etc. 2. ^{{cite book | title = The Art Of Assembly Language Programming | first = Randall | last = Hyde | year = 1996 | url = http://www.oopweb.com/Assembly/Documents/ArtOfAssembly/VolumeFrames.html | chapter = CHAPTER SEVENTEEN: INTERRUPTS TRAPS AND EXCEPTIONS (Part 1) | quote = The concept of an interrupt is something that has expanded in scope over the years. The 80x86 family has only added to the confusion surrounding interrupts by introducing the int (software interrupt) instruction. Indeed different manufacturers have used terms like exceptions faults aborts traps and interrupts to describe the phenomena this chapter discusses. Unfortunately there is no clear consensus as to the exact meaning of these terms. Different authors adopt different terms to their own use. While it is tempting to avoid the use of such misused terms altogether for the purpose of discussion it would be nice to have a set of well defined terms we can use in this chapter. Therefore we will pick three of the terms above interrupts traps and exceptions and define them. This chapter attempts to use the most common meanings for these terms but don't be surprised to find other texts using them in different contexts. | chapterurl = http://www.oopweb.com/Assembly/Documents/ArtOfAssembly/Volume/Chapter_17/CH17-1.html}} 3. ^{{cite web|title=The Jargon File, version 4.4.7|date=2003-10-27|accessdate=2007-02-03|url=http://catb.org/esr/jargon/html/T/trap.html}} 4. ^{{cite web|title=handler.apply() - JavaScript MDN:|url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/apply}} References 2 : Computing terminology|Unix |
随便看 |
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。