Path: utzoo!attcan!uunet!mcvax!unido!fauern!faui44!mlelstv From: mlelstv@faui44.informatik.uni-erlangen.de (Michael van Elst ) Newsgroups: comp.sys.amiga.tech Subject: Re: Resources Message-ID: <734@faui10.informatik.uni-erlangen.de> Date: 15 Nov 88 13:41:19 GMT References: <1947@van-bc.UUCP> <7636@well.UUCP> Reply-To: mlelstv@faui44.UUCP (Michael van Elst (kdebugger)) Organization: CSD., University of Erlangen, W - Germany Lines: 28 In article <7636@well.UUCP> ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) writes: > Suppose I want the use of one of the CIA ports. I would call >OpenResource() on the relevant port, and dance on it. While I'm dancing on >it, it'd be real nice if I could be sure that no one else will be dancing on >it. One would think that the OpenResource()/CloseResource() pair (if it >existed) would arbitrate access to the relevant resource. > >... > So. Given the lack of CloseResource(), does this mean that >OpenResource() does not guarantee exclusive access? If this is so, how does >one arbitrate the access to "resources" to prevent collisions? > The answer is simple. OpenResource just gives you access to the resource library. It doesn't allocate or arbitrate anything. Thus you don't have to CloseResource it. To allocate the ports you have to open misc.resource and call GetMiscResource and FreeMiscResource to arbitrate access to the port bits. I wrote a small program that uses the parallel port to drive a GAL programmer. If someone is interested, I may mail the source Michael van Elst E-mail: UUCP: ...uunet!unido!fauern!faui44!mlelstv