From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!think!bloom-beacon!mit-eddie!rutgers!ucla-cs!sm.unisys.com!CAM.UNISYS.COM!jonab From: jonab@CAM.UNISYS.COM (Jonathan P. Biggar) Newsgroups: comp.lang.ada Subject: Re: Pragma SHARED, tasks and shared variables Message-ID: <431@sdcjove.CAM.UNISYS.COM> Date: 28 Jul 88 16:33:07 GMT References: <8807280055.AA27279@ajpo.sei.cmu.edu> Reply-To: jonab@cam.unisys.com (Jonathan P. Biggar) Organization: UNiSYS R+D Distributed Architectures, Camarillo, CA List-Id: In article <8807280055.AA27279@ajpo.sei.cmu.edu> IVANOVIC%VAXR@CIRCUS.LLNL.GOV ("Vladimir Ivanovic, x3-7786") writes: > I realize that my particular implementation (VAX Ada v1.4) allows > the use of pragma VOLATILE which is the same as pragma SHARED without > the words "and whose type is a scalar or access type", essentially > giving me what I want, but pragma VOLATILE is not portable across > implementations. However, pragma SHARED is not portable across implementations either. You cannot predict what any given implementation is going to consider a "scalar" type that can be accessed atomically. Implementations that support SHARED probably will not allow you to use it on a variable that is not scalar or access anyway. Try and look at your system again and see if you can change the way you allocate tasks in order to reduce the severity of your problem. For example, if you need to access the data structure several times in a short period, consider using a task that just acts as a semaphore, allowing another task to seize the resource, access the data structure directly, and then release the resource. Jon Biggar jonab@cam.unisys.com