comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: How to do multiple instances of a generic packages in automated way. (using ravenscar profile)
Date: Tue, 5 Apr 2016 10:39:04 -0700
Date: 2016-04-05T10:39:04-07:00	[thread overview]
Message-ID: <ne0t1k$um3$1@dont-email.me> (raw)
In-Reply-To: <56ff6352-590e-4de7-a361-bc2fec0538fb@googlegroups.com>

On 04/05/2016 10:09 AM, danielnorberto@gmail.com wrote:
>
> I have a generic package with a buffer functionality encapsulated using
> Ravenscar pragma profile.
>
> This buffer has also a protected procedures an entries for multitasking.
>
> I need to instantiate several of this packages. In this moment the code is
> working in this way:
>
> The problem is that  i will need a quantity up to 500 or 1000 independent
> buffers packages, so i'm trying to think in other way to instantiate this
> generics packages than fill 500 or 1000 lines of instances.

Without knowing more about your hundreds of buffers, what purpose(s) they serve, 
how they're similar and how they differ, I can't provide any useful advice. I 
won't let that stop me, though.

Typically, task-safe buffers are used to allow asynchronous communications 
between tasks. Typically the buffer is a protected type, and once instantiated 
for the type of information passed in the buffer, multiple objects of the type 
can be declared (in an array, for example).

If you're using Ada 12, then the standard synchronized-queue containers can 
serve this purpose (assuming they meet all your requirements, including the 
Ravenscar restrictions). If you're using an earlier version of the language, 
then you could use something like PragmARC.Queue_Unbounded_Blocking.

The synchronized queues are described in ARM A.18.27-29

http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-A-18-27.html

The PragmAda Reusable Components are available at

https://pragmada.x10hosting.com/pragmarc.htm

or through the copy at GitHub

https://github.com/jrcarter/PragmARC

If neither of these is suitable for your needs, nor gives you an insight into a 
way to meet your needs, then you can provide more information, including your 
generic pkg spec and the details of some of the actual generic parameters used 
to instantiate a couple of the instances, and perhaps we can see an alternative 
approach.

-- 
Jeff Carter
"Nobody expects the Spanish Inquisition!"
Monty Python's Flying Circus
22

  reply	other threads:[~2016-04-05 17:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-05 17:09 How to do multiple instances of a generic packages in automated way. (using ravenscar profile) danielnorberto
2016-04-05 17:39 ` Jeffrey R. Carter [this message]
2016-04-05 19:39   ` Simon Wright
2016-04-07 12:05 ` danielnorberto
2016-04-07 12:36   ` G.B.
2016-04-11  9:14     ` Daniel Norber
2016-04-11 13:04       ` Shark8
2016-04-11 17:25         ` Daniel Norber
2016-04-11 15:58       ` Anh Vo
2016-04-11 17:21         ` Daniel Norber
2016-04-11 17:26           ` Anh Vo
2016-04-11 16:59       ` Jeffrey R. Carter
2016-04-11 17:23         ` Daniel Norber
2016-04-11 17:27           ` Jeffrey R. Carter
2016-04-12  5:19           ` Brad Moore
2016-04-26 15:08             ` Daniel Norber
2016-05-05 21:01 ` rieachus
replies disabled

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