comp.lang.ada
 help / color / mirror / Atom feed
From: Gene <gene.ressler@gmail.com>
Subject: Re: Protected Objects And Many Processors
Date: Sat, 5 Feb 2011 17:22:54 -0800 (PST)
Date: 2011-02-05T17:22:54-08:00	[thread overview]
Message-ID: <f3faa044-6a8e-4ad6-a165-46c5400ea3e0@glegroupsg2000goo.googlegroups.com> (raw)
In-Reply-To: <4d39cbde$0$6882$9b4e6d93@newsspool2.arcor-online.net>

You mean using rendezvous instead of protected types?  With rendezvous you'd need a "server" task for each shared object to serialize operations on it. (You would not want to use the single connecting task shown in your diagram for this purpose because giving it different  jobs like this would decrease available parallelism.)  Even if there is no contention, every object access would require execution in two threads with this scheme. With protected types, only a single thread runs in the no-contention case.  

Queueing a thread on a lock and then restarting it would have to be free to erase the difference in cost. 

While it might be cheaper to queue and restart across cores and/or CPUs than to swap contexts in a single core, it will never be free, and the exact overhead will be extremely architecture dependent, including cache, OS (thread affinity policy especially), and RTL implementation.  You'd have to find out how bad the news is by studying documentation and finally by testing.  In most environments the protected type will still be considerably more efficient.  As its name implies, rendezvous is best for synchronizing execution control flow, passing at most one chunk of data between tasks at a time.



      parent reply	other threads:[~2011-02-06  1:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-21 18:09 Protected Objects And Many Processors Georg Bauhaus
2011-01-21 19:31 ` Yannick Duchêne (Hibou57)
2011-01-21 20:35   ` Dmitry A. Kazakov
2011-01-21 21:48     ` Yannick Duchêne (Hibou57)
2011-01-21 22:32     ` Yannick Duchêne (Hibou57)
2011-01-24 11:29       ` comp.lang.php
2011-01-24 14:53         ` Dmitry A. Kazakov
2011-01-21 19:55 ` Jeffrey Carter
2011-01-21 20:31   ` Yannick Duchêne (Hibou57)
2011-01-22  5:16     ` Randy Brukardt
2011-02-06 20:04       ` Yannick Duchêne (Hibou57)
2011-02-06  1:22 ` Gene [this message]
replies disabled

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