comp.lang.ada
 help / color / mirror / Atom feed
From: jonab@CAM.UNISYS.COM (Jonathan P. Biggar)
Subject: Re: Pragma SHARED, tasks and shared variables
Date: 28 Jul 88 16:33:07 GMT	[thread overview]
Message-ID: <431@sdcjove.CAM.UNISYS.COM> (raw)
In-Reply-To: 8807280055.AA27279@ajpo.sei.cmu.edu

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

  reply	other threads:[~1988-07-28 16:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1988-07-28  1:03 Pragma SHARED, tasks and shared variables "Vladimir Ivanovic, x3-7786"
1988-07-28 16:33 ` Jonathan P. Biggar [this message]
  -- strict thread matches above, loose matches on Subject: below --
1988-07-28 14:12 Norman Cohen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox