From: "Egil Høvik" <egilhovik@hotmail.com>
Subject: Re: GNAT's Protected Objects
Date: Tue, 9 Nov 2010 02:18:27 -0800 (PST)
Date: 2010-11-09T02:18:27-08:00 [thread overview]
Message-ID: <7312123d-3308-45ce-8d8c-89c0df588a81@j25g2000yqa.googlegroups.com> (raw)
In-Reply-To: ib9ts1$91l$1@tornado.tornevall.net
On Nov 8, 11:32 pm, Jeffrey Carter
<spam.jrcarter....@spam.not.acm.org> wrote:
>
> Result : Matrix;
Result is shared between multiple tasks,
reduce references to a minimum by using a
temporary value:
>
> task body Calc_One is
> Row : Natural;
> Col : Natural;
Temp_Result : Float;
> begin -- Calc_One
> All_Results : loop
> Control.Get (Row => Row, Col => Col);
>
> exit All_Results when Row = 0;
>
Temp_Result := 0.0;
>
> Sum : for K in Index_Value loop
Temp_Result := Temp_Result + Left (Row, K) * Right(K,
Col);
> end loop Sum;
Result(Row, Col) := Temp_Result ;
> end loop All_Results;
> exception -- Calc_One
> when E : others =>
> Ada.Text_IO.Put_Line (Item => "Calc_One " &
> Ada.Exceptions.Exception_Information (E) );
> end Calc_One;
This should give you a nice speedup :)
--
~egilhh
next prev parent reply other threads:[~2010-11-09 10:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-08 20:34 GNAT's Protected Objects Jeffrey Carter
2010-11-08 21:38 ` Anh Vo
2010-11-08 22:32 ` Jeffrey Carter
2010-11-08 22:43 ` Robert A Duff
2010-11-09 0:27 ` Jeffrey Carter
2010-11-09 14:21 ` Robert A Duff
2010-11-09 18:23 ` Jeffrey Carter
2010-11-09 10:05 ` Egil Høvik
2010-11-09 1:50 ` Anh Vo
2010-11-09 3:14 ` Jeffrey Carter
2010-11-09 2:03 ` Peter C. Chapin
2010-11-09 10:18 ` Egil Høvik [this message]
2010-11-09 11:17 ` Julian Leyh
2010-11-09 18:22 ` Jeffrey Carter
[not found] ` <s5GdnRvDRfR6-0XRnZ2dnUVZ_hOdnZ2d@earthlink.com>
2010-11-08 22:41 ` Jeffrey Carter
2010-11-09 10:36 ` Maciej Sobczak
2010-11-24 7:08 ` Brad Moore
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox