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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,16594902ce57591b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed01.chello.at!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Multitasking and containers Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <143yx0dos45nx.159wpxvfevtt8.dlg@40tude.net> <1164623427.5986.11.camel@localhost> <1164656708.657952.123430@j72g2000cwa.googlegroups.com> Date: Tue, 28 Nov 2006 09:50:03 +0100 Message-ID: NNTP-Posting-Date: 28 Nov 2006 09:50:03 CET NNTP-Posting-Host: ea7f645c.newsspool1.arcor-online.net X-Trace: DXC=OdLXfj>V4kdf1oJaJ0@dmgic==]BZ:afn4Fo<]lROoRa^YC2XCjHcbiWXF>HG;jMmcDNcfSJ;bb[eFCTGGVUmh?dN\HXHJ4e80niD\lPfKiP^k X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:7723 Date: 2006-11-28T09:50:03+01:00 List-Id: On Tue, 28 Nov 2006 02:19:55 GMT, Matthew Heaney wrote: > "Dr. Adrian Wrigley" writes: > >> Actually, I think Dmitry's view is largely valid in practice, if >> somewhat extreme. > > But we were talking specifically about using a protected object to implement a > multiple readers schema vs. using a protected object to implement a Hoare-style > monitor. Because reads must by synchronized, the standard container library > requires a monitor-style synchronization scheme. > > The OP made the argument that this isn't very efficient, and Dmitry responded > by saying, "well of course systems require custom hand-made solutions." But the > premise is all wrong, so what Dmitry said is irrelevant. The OP (not Dmitry) > seems to be confused (he was asking the question, after all) about the > difference between a mutex and a monitor. He (the OP) probably doesn't > understand that monitor-type synchronization executes on the current thread, so > there's no context switch, and so there's no efficiency loss. I read OP question very differently. He said (let Maciej correct me): 1. That accessing a mutable operation disguised as a protected object's function were wrong. 2. Using a protected object's procedure/entry would kill concurrency by serialization of the action to undertake. Both statements are evidently true. My comments considered possible solutions *provided* that 2 were really a problem, because as Jeffrey rightly pointed out, the loss of performance could be actually minor. But that depends. It is easy to imagine a situation (massively parallel computing with shared memory) where the loss could be huge. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de