From owner-freebsd-hackers Sat Jul 4 13:21:02 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA09249 for freebsd-hackers-outgoing; Sat, 4 Jul 1998 13:21:02 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from bingsun1 (bingsun1.cc.binghamton.edu [128.226.1.2]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id NAA09240 for ; Sat, 4 Jul 1998 13:21:00 -0700 (PDT) (envelope-from bf20761@binghamton.edu) Received: from localhost (bf20761@localhost) by bingsun1 (SMI-8.6/8.6.9) with SMTP id QAA19647 for ; Sat, 4 Jul 1998 16:20:57 -0400 Date: Sat, 4 Jul 1998 16:20:57 -0400 (EDT) From: zhihuizhang X-Sender: bf20761@bingsun1 To: hackers Subject: Lock mechanism questions Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I think lock is done through some test-and-set hardware instruction. I read the Intel documents and find many instructions can be used for such purpose provided you add the LOCK prefix (However, those instructions do not include SAL mentioned in a previous posting). With these in mind, I began search in vain for something like XCHG, CMPXCHG. However, I do find that in file vm/lock.h, there are comments like: "interlock field is used for hardware exclusion, other fields are modified with *normal* instructions after we got the interlock *bit*" I am confused with this comments. Where is the interlock field defined? Which hardware instruction is used to implement atomic operation on it? By the way, I know spin lock is not suitable for interrupt routines that access the same data structures. Can anyone give me a reason for this? Thanks a lot. ------------------------------------------------- Zhihui Zhang Department of Computer Science State University of New York at Binghamton Web Site: http://cs.binghamton.edu/~zzhang ------------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message