Article View: comp.os.mach
Article #923Re: interrupt and simple_locks
From: Rong Chen
Date: Thu, 04 Apr 1991 03:30
Date: Thu, 04 Apr 1991 03:30
28 lines
1783 bytes
1783 bytes
From: Michael_Young@transarc.com To: rchen@m.cs.uiuc.edu Subject: Re: interrupt and simple_locks > While I was reading the source code of Mach3.0, I noticed that > the hardware interrupts, if any, are always turned off before > a simple-lock is applied to a Mach object. ... If an interrupt handler may try to take that latch, interrupt protection is required. In your example, the scheduling system needs to take the latches in question at timer interrupt time, so those scheduling latches require protection. Many objects (e.g., in the VM system) are never handled at interrupt level, and therefore don't need protection. > It is true that an interrupt may arrive after an object has > been locked, but that should not cause any harm, right? Wrong. The interrupt handler may try to take the latch. If the latch was already taken, the interrupt handler would spin forever. Interrupts cannot be rescheduled the way normal threads can be. The network service thread (in Mach 2.5 at least) is an example of how to get around this problem. The interrupt handler queues work for a real thread. The real thread can get rescheduled, so it can take latches. Those latches don't need interrupt protection. Feel free to repost this; I cannot post directly from here.
Technical Details
Message-ID:
<1991Apr4.033030.22638@m.cs.uiuc.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!m.cs.uiuc.edu!rchenReferences:
<1991Apr3.184610.12580@m.cs.uiuc.edu> <4799@lectroid.sw.stratus.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.mach Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!m.cs.uiuc.edu!rchen From: rchen@m.cs.uiuc.edu (Rong Chen) Subject: Re: interrupt and simple_locks Message-ID: <1991Apr4.033030.22638@m.cs.uiuc.edu> Organization: University of Illinois, Dept. of Comp. Sci., Urbana, IL References: <1991Apr3.184610.12580@m.cs.uiuc.edu> <4799@lectroid.sw.stratus.com> Distribution: comp Date: Thu, 4 Apr 91 03:30:30 GMT Lines: 33