comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <no.spam@no.spam.com>
Subject: Re: Multitasking and containers
Date: Wed, 29 Nov 2006 11:14:35 +0100
Date: 2006-11-29T11:14:35+01:00	[thread overview]
Message-ID: <ekjmib$qlt$1@cernne03.cern.ch> (raw)
In-Reply-To: <zq2w04z5om85.1adxu3bs3a773$.dlg@40tude.net>

Dmitry A. Kazakov wrote:

>> The OP (not Dmitry)
>> seems to be confused (he was asking the question, after all) about the
>> difference between a mutex and a monitor.

I was asking a question about strategy to use a standard container in a 
multitasking environment, not what's the difference between a mutex and 
a monitor. I don't see any implication for confusion in the latter.

>> 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.

The efficiency loss might be possible due to contention on the shared 
resource. It is clear that with single CPU there is nothing to fuss 
over, but the concept of "single CPU" became somewhat fuzzy nowadays.

> 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.

And that's exactly what I meant.

> My comments considered possible solutions *provided* that 2 were really a
> problem

And that's absolutely a non-issue. I'm interested in principles and 
rationale - a clear understanding of the tools is crucial at the very 
early stages of project development, because it's when the decisions 
have the biggest impact on later phases.

What I've learned in this thread is that:
1. Ada standard containers should be protected against concurrent 
accesses (in the general meaning of "access") and it's the obligation of 
the user to do it.
2. This serializes all users of the container with obvious consequences.

Whether any of these two is a problem in any particular project is a 
non-issue. The point is that these two facts are to be understood, so 
that they can be taken into account when there's a time to do so.


-- 
Maciej Sobczak : http://www.msobczak.com/
Programming    : http://www.msobczak.com/prog/



  parent reply	other threads:[~2006-11-29 10:14 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
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 [this message]
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