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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9bc0262607f781e9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-07 04:11:53 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!news-out.visi.com!hermes.visi.com!cox.net!newsfeed1.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!f7c2b8a7!not-for-mail Message-ID: <3D00956A.E19C904A@earthlink.net> From: "Marc A. Criley" Organization: Quadrus Corporation X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Making a package safe for use by multiple tasks References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 07 Jun 2002 11:11:47 GMT NNTP-Posting-Host: 63.190.213.91 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 1023448307 63.190.213.91 (Fri, 07 Jun 2002 04:11:47 PDT) NNTP-Posting-Date: Fri, 07 Jun 2002 04:11:47 PDT Xref: archiver1.google.com comp.lang.ada:25444 Date: 2002-06-07T11:11:47+00:00 List-Id: Alexander Boucke wrote: > > Hello! > > I am just playing with the idea to use multiple tasks in a programm doing > linear algebra. The problem lies in my vector-algebra package, that uses > some global tmp-object to optimize memory use and reuse. To give you the > idea, some not necessarily correct code snippets what this is doing: > > This is of course not usable if I use more then one task! And converting the > whole thing in some kind of protected type is certainly not very useful, > since this would it would not allow parallel execution of vector operations > then. > > Except of getting rid of these tmp_vec things, does anybody of you have an > idea, how this could be dealt with. The idea is, that every task needs to > have it's own temporary object. But I have no idea how this could be be > achieved in an automatic or semi-automatic way. Just off the top of my head...I don't know if this would be practical for you or not, but if you just want to try something quick and dirty, you could try this: Convert the package into a generic package, i.e., just add "generic" to the package spec, then instantiate an instance of the package for each task. It's an inelegant and wasteful hack, but hey, I warned you that it was quick and dirty :-) :-) Marc A. Criley Consultant Quadrus Corporation www.quadruscorp.com