home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!not-for-mail
- From: avg@rodan.UU.NET (Vadim Antonov)
- Newsgroups: comp.programming
- Subject: Re: Semaphores, Swap, or Test_And_Set
- Date: 22 Dec 1992 18:20:53 -0500
- Organization: UUNET Technologies Inc, Falls Church, VA
- Lines: 42
- Message-ID: <1h87slINNshf@rodan.UU.NET>
- References: <1992Dec22.055727.8056@nestmoi.rain.com> <1h7htbINNdg6@usenet.INS.CWRU.Edu> <1992Dec22.192229.17569@pasteur.Berkeley.EDU>
- NNTP-Posting-Host: rodan.uu.net
-
- In article <1992Dec22.192229.17569@pasteur.Berkeley.EDU> johnm@cory.Berkeley.EDU (John D. Mitchell) writes:
- >In article <1h7htbINNdg6@usenet.INS.CWRU.Edu> trier@slc6.ins.cwru.edu (Stephen C. Trier) writes:
- >[...]
- >>I've been trying to figure out whether that LOCK prefix is necessary when
- >>sharing the code between several virtual 8086s running on one 386. I have
- >>been unable to get a clear answer to this question -- is the LOCK prefix
- >>useful only for multiprocessors that take advantage of it, or does it also
- >>make the instruction noninterruptible?
- >
- >The LOCK prefix code of the i80x86 CPUs locks down the system bus. On a
- >uniprocessor system it's only relevant if there is bus activity going on by
- >the processor's back (e.g., DMA (which makes the system essentially a form
- >of asymetrical multiprocessor :-)).
-
- Never mind DMA. So far i saw no x86 machines (even real multiprocessors
- like Sequent i currently enjoy looking at through my office door)
- which have circuitry protecting DMA from colliding with locked memory
- locations.
-
- LOCK prefix is useful only for multiprocessing, period.
- 386 isn't really good for multiprocessing (no per-page cacheability
- control), it was amended in 486 (but they added non-coherent internal
- cache to keep life funnier, sigh).
-
- >>An answer to the effect of, "A 386 instruction is never interruptible" is
- >>OK, too -- I haven't been able to dig that sort of information out of the
- >>references I can find.
-
- Wrong. Page faults DO interrupt 386 instructions. REP... instructions
- are interruptible by any interrupt source. 386 provides for
- restartability, not for non-interruptability of instructions.
-
- >Note that some instructions can *NOT* be preceded by the LOCK
- >prefix.
-
- I'd say *MOST* instructions cannot be preceded by the LOCK
- (486 manuals explicitly state that). See Intel's "Microprocessors
- vol I, 1992". Register<->memory XCGH should not be preceded by LOCK
- because it asserts LOCK signal automatically (for the sake of
- compatibility with 8086 -- who needs it?)
-
- --vadim
-