Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!ames!sgi!shinobu!odin!moose.asd.sgi.com!jwag From: jwag@moose.asd.sgi.com (Chris Wagner) Newsgroups: comp.sys.sgi Subject: Re: locks Keywords: locks Message-ID: <1990Oct9.212103.20357@odin.corp.sgi.com> Date: 9 Oct 90 21:21:03 GMT References: <1990Oct9.151517.18350@csrd.uiuc.edu> Sender: news@odin.corp.sgi.com (Net News) Reply-To: jwag@moose.asd.sgi.com (Chris Wagner) Distribution: comp.sys.sgi Organization: Silicon Graphics, Research & Development Lines: 34 In article <1990Oct9.151517.18350@csrd.uiuc.edu>, williams@sp14.csrd.uiuc.edu (Peter Lawrence Williams) writes: > > I need a lot of locks for a program I'm developing, and plan on using > multiplexed locks. The following are some questions which I couldn`t > find answers to in the man pages or ulock.h. > > I'd like to know how to determine whether a particular SGI machine has > soft or hard locks. Also how much memory in the shared area is required > per soft lock. u_locks.h say there can be a maximum of 4096 hard locks > per share group, so I'm going to create exactly 4096 locks and assume > that my code should then be portable across machines regardless of whether > they have soft or hard lock capability. I am assuming that 4096 soft locks > will fit in the default 64K shared area. > > Any pointers to example code using u_locks.h? > > Thank you, > Peter Williams > williams@csrd.uiuc.edu To determine whether a machine has hard/soft locks there are 2 easy ways: 1) look for the device /dev/hl 2) if you have a multi-processor then you got hardware locks the 4096 number is somewhat arbitrary - you won't actually get that many - the usinit logic uses a few. There was also a bug in 3.2 that prevented one from getting more than about 1024 hardware locks. 4096 locks will NOT fit in 64k to my knowledge - try bumping it up to 256K (more if you rutn on debugging/metering) Chris Wagner