locks

Chris Wagner jwag at moose.asd.sgi.com
Wed Oct 10 07:21:03 AEST 1990


In article <1990Oct9.151517.18350 at csrd.uiuc.edu>,
williams at 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 at 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



More information about the Comp.sys.sgi mailing list