comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Multitasking and containers
Date: Tue, 28 Nov 2006 09:50:03 +0100
Date: 2006-11-28T09:50:03+01:00	[thread overview]
Message-ID: <zq2w04z5om85.1adxu3bs3a773$.dlg@40tude.net> (raw)
In-Reply-To: uvel0qpmi.fsf@earthlink.net

On Tue, 28 Nov 2006 02:19:55 GMT, Matthew Heaney wrote:

> "Dr. Adrian Wrigley" <amtw@linuxchip.demon.co.uk.uk.uk> 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



  reply	other threads:[~2006-11-28  8:50 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-24  8:51 Multitasking and containers Maciej Sobczak
2006-11-24 10:11 ` Georg Bauhaus
2006-11-24 10:19 ` Dmitry A. Kazakov
2006-11-24 10:35   ` Maciej Sobczak
2006-11-24 11:14     ` Dmitry A. Kazakov
2006-11-24 12:13       ` Matthew Heaney
2006-11-27  4:17         ` Jeffrey R. Carter
2006-11-27 10:30           ` Georg Bauhaus
2006-11-27 18:41             ` Jeffrey R. Carter
2006-11-27 18:57               ` Dmitry A. Kazakov
2006-11-27 19:45               ` Matthew Heaney
2006-11-27 21:15                 ` Simon Wright
2006-11-28  1:43                 ` Dr. Adrian Wrigley
2006-11-28  2:19                   ` Matthew Heaney
2006-11-28  8:50                     ` Dmitry A. Kazakov [this message]
2006-11-28 10:31                       ` Georg Bauhaus
2006-11-28 11:24                         ` Dmitry A. Kazakov
2006-11-29  8:51                           ` Georg Bauhaus
2006-11-28 17:12                       ` Matthew Heaney
2006-11-28 18:21                         ` Dmitry A. Kazakov
2006-11-28 19:17                           ` Matthew Heaney
2006-11-29 18:43                             ` Dmitry A. Kazakov
2006-11-29 10:14                       ` Maciej Sobczak
2006-11-29 15:50                         ` Matthew Heaney
2006-11-24 12:12     ` Matthew Heaney
2006-11-24 12:05   ` Matthew Heaney
2006-11-24 12:02 ` Matthew Heaney
replies disabled

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