comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: GNAT's Protected Objects
Date: Tue, 9 Nov 2010 02:36:35 -0800 (PST)
Date: 2010-11-09T02:36:35-08:00	[thread overview]
Message-ID: <3747e4ff-811c-4d7c-8541-a5f9573decfc@30g2000yql.googlegroups.com> (raw)
In-Reply-To: ib9mv1$23q$1@tornado.tornevall.net

On 8 Lis, 21:34, Jeffrey Carter <spam.jrcarter....@spam.not.acm.org>
wrote:

> If I use a Linda-like approach, with a protected procedure doling out (Row,
> Column) pairs on demand, a single task is always fastest, and using multiple
> tasks slows things down. This wasn't what I expected, and wondered if this is
> inherent in such an approach, or specific to GNAT's way of implementing
> protected objects.

The protected object is shared between tasks and this sharing forces
the cache to flush and synchronize between cores (or CPUs). Note that
cache operates on entire blocks, which adds to the cost of data
transfer. If you measure the CPU utilization, you will probably see
that it is mostly idle during this test. Adding more CPUs will only
make things worse.

In other words, you have hoped for increased performance thanks to
additional computing resources, but you lost more on communication
between them.

The first version scales better, because it shares less (less often).

--
Maciej Sobczak * http://www.inspirel.com



  parent reply	other threads:[~2010-11-09 10:36 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
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 [this message]
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