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=0.7 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,30dd116614f4610e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Gene Newsgroups: comp.lang.ada Subject: Re: Protected Objects And Many Processors Date: Sat, 5 Feb 2011 17:22:54 -0800 (PST) Organization: http://groups.google.com Message-ID: Reply-To: comp.lang.ada@googlegroups.com NNTP-Posting-Host: 184.12.84.139 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1296955375 7498 127.0.0.1 (6 Feb 2011 01:22:55 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 6 Feb 2011 01:22:55 +0000 (UTC) In-Reply-To: <4d39cbde$0$6882$9b4e6d93@newsspool2.arcor-online.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=184.12.84.139; posting-account=-BkjswoAAACC3NU8b6V8c50JQ2JBOs04 User-Agent: G2/1.0 Xref: g2news2.google.com comp.lang.ada:17866 Date: 2011-02-05T17:22:54-08:00 List-Id: 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 diagr= am for this purpose because giving it different jobs like this would decre= ase available parallelism.) Even if there is no contention, every object a= ccess would require execution in two threads with this scheme. With protect= ed types, only a single thread runs in the no-contention case. =20 Queueing a thread on a lock and then restarting it would have to be free to= erase the difference in cost.=20 While it might be cheaper to queue and restart across cores and/or CPUs tha= n to swap contexts in a single core, it will never be free, and the exact o= verhead will be extremely architecture dependent, including cache, OS (thre= ad 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 ef= ficient. As its name implies, rendezvous is best for synchronizing executi= on control flow, passing at most one chunk of data between tasks at a time.