comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Private or public task ?
Date: Tue, 09 Feb 2010 10:20:03 -0500
Date: 2010-02-09T10:20:03-05:00	[thread overview]
Message-ID: <wccmxzimo64.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: f7048897-bce0-4e1d-8f49-85fe274d7292@v25g2000yqk.googlegroups.com

"Hibou57 (Yannick Duch�ne)" <yannick_duchene@yahoo.fr> writes:

> Let temporarily suppose so. But remains another wolf in the wood :
> what if the application is running in a multiprocessors environment
> and its thread are not executed on the same CPU ? If one task on CPU#1
> was to enter a procedure of a protected object while a task on CPU#2
> is actually running a procedure on the same protected object, then,
> the task running on CPU#1 must be delayed, and thus, the procedure is
> blocking.
>
> Sure a procedure of a protected type or object should be short and
> quick to execute, but it seems to still remains potentially blocking.

You should read all the stuff in the Real Time annex about priorities
and ceilings and policies and whatnot.

No, protected procedures and functions are not potentially blocking.

In your multiprocessor example, task#1 cannot procede
into the protected procedure until task#2 lets go
of it, but that's not blocking.  No lower-or-equal priority
task can preempt task#1.  One possible implementation is
that task#1 spins on the lock, which is OK because you
made sure your protected procedure executes in a short
bounded time.

This all depends on using the right real-time policy.  Other policies
are possible -- and likely, when running on top of a desktop OS.

Protected entries, on the other hand, are potentially blocking,
because they put the task to sleep for an arbitrarily long time
(until the barrier becomes True).

- Bob



  parent reply	other threads:[~2010-02-09 15:20 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-05 20:54 Private or public task ? Hibou57 (Yannick Duchêne)
2010-02-05 20:56 ` Hibou57 (Yannick Duchêne)
2010-02-05 21:38 ` Jeffrey R. Carter
2010-02-05 21:53   ` Hibou57 (Yannick Duchêne)
2010-02-08  9:55     ` Alex R. Mosteo
2010-02-08 10:02     ` Jean-Pierre Rosen
2010-02-08 17:28     ` Maciej Sobczak
2010-02-09  8:43       ` Dmitry A. Kazakov
2010-02-09 12:07       ` Hibou57 (Yannick Duchêne)
2010-02-09 14:26         ` Jean-Pierre Rosen
2010-02-09 18:17           ` Hibou57 (Yannick Duchêne)
2010-02-10  8:17           ` Maciej Sobczak
2010-02-10  8:29             ` Hibou57 (Yannick Duchêne)
2010-02-10  8:40               ` Martin
2010-02-10 11:44                 ` Jean-Pierre Rosen
2010-02-10 12:51                   ` Martin
2010-02-10 16:17                 ` Robert A Duff
2010-02-10 11:38             ` Jean-Pierre Rosen
2010-02-13 11:09           ` Dmitry A. Kazakov
2010-02-09 15:20         ` Robert A Duff [this message]
2010-02-09 18:26           ` Hibou57 (Yannick Duchêne)
2010-02-09 14:44       ` Alex R. Mosteo
2010-02-09 23:38   ` mkasun
2010-02-09 23:51     ` Robert A Duff
2010-02-10  0:01     ` Jeffrey R. Carter
2010-02-05 21:40 ` Dmitry A. Kazakov
2010-02-05 22:09   ` Hibou57 (Yannick Duchêne)
2010-02-05 22:57     ` sjw
2010-02-06  2:20   ` Hibou57 (Yannick Duchêne)
2010-02-06  2:23     ` Hibou57 (Yannick Duchêne)
2010-02-06  3:29     ` Jeffrey R. Carter
replies disabled

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