From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,7b17c7e8b77cdcfe X-Google-Attributes: gidfee84,public From: davidm@cs.arizona.edu (David Mosberger-Tang) Subject: Re: Alpha UNIX Shared Memory - Need Ideas Date: 1996/04/23 Message-ID: #1/1 X-Deja-AN: 151054011 sender: davidm@piston.cs.arizona.edu references: <4ledut$nql@news1.h1.usa.pipeline.com> organization: The University of Arizona, Tucson, AZ newsgroups: comp.unix.osf.osf1 In article <4ledut$nql@news1.h1.usa.pipeline.com> rsurwilo@usa.pipeline.com(Richard A. Surwilo) writes: Richard> Our application is a very high volume message switching Richard> system and each process currently utilizes thousands of Richard> locks. UNIX semaphores would appear to be too Richard> inefficient. Using UNIX file/record locking has been Richard> suggested but I think it too would exact too much of a Richard> performance penalty. Richard> Is there a library of low-level, granular, atomic locking Richard> routines available on an Alpha running UNIX? SVR4 Richard> compliance is immaterial. It just needs to be fast. Wouldn't msem_init()/msem_lock()/msem_unlock() together with a shared memory segment do what you want? I haven't looked at exactly how they're implemented, but msem_lock() does call a library internal function called _msem_tas() which uses the load linked/store conditional instructions of the Alpha to do an atomic test-and-set. Of course, if you don't mind Alpha assembly, you could just use loaded linked/store conditional directly. --david -- David Mosberger-Tang; Dept. of CS; The University of Arizona; Tucson, AZ 85721 davidm@cs.arizona.edu http://www.AZStarNet.com/~davidm