Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!necntc!ames!sdcsvax!ucbvax!UNO.BITNET!BEB From: BEB@UNO.BITNET Newsgroups: comp.os.vms Subject: Re: Re: interprocess communication without privs Message-ID: <8709250952.AA07381@ucbvax.Berkeley.EDU> Date: Wed, 23-Sep-87 16:50:00 EDT Article-I.D.: ucbvax.8709250952.AA07381 Posted: Wed Sep 23 16:50:00 1987 Date-Received: Sat, 26-Sep-87 19:32:03 EDT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 42 >From: Jamie Hanrahan > >A previously-posted summary of the standard interproc. comm. techniques >(can't seem to find the article, or I'd run this as a followup thereto) >was quite good. I can only add two things: First, global sections >alone are not enough -- you also need an interproc. synchronization >technique to control access to the section. This can be common event >flags (limited to procs within a UIC group), hiber/wake, or the lock >manager. Which is more suitable depends on the function you want. Or use the BBSSI inst to implement mutual exclusion routines. Example: .Entry MUTEXON,^M<> ; loop til MUTEX_FLAG cleared, then set 1$: BBSSI #0,@MUTEX_FLAG,1$ ; where MUTEX_FLAG is in global section MOVB #1,@4(ap) ; we have control RET .Entry MUTEXOFF,^M<> ; give up control of global section CLRB @MUTEX_FLAG ; clear flag in global section space CLRB @4(AP) ; return "no control" status RET Or for Macro haters, the LIB$BBSSI RTL routine allows a HLL access to the BBSSI inst. Of course you immediately notice this turkey is a polling loop gobbling CPUtime like there is no DD-MMM-YYYY +1. Well, for an (user interactive) application that can hibernate and wake up, say, ten or more times a second, it works very well, and isn't too expensive, depending on how much you have to do every time it wakes up, how much contention for mutex, etc... The big win here is that it is really simple to set up. Just create your global section and bracket any code that munges on it with the mutexon/mutexoff calls. Bruce <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> <>Handle: Bruce Bettis <>USnail: University of New Orleans <> <> <> Computer Research Center <> <>BITnet: <> New Orleans, La. 70148 <> <> <> <> <>Voices: (504) 286-7067 <> (Assume appropriate disclaimer) <> <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>