From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Tasking without Protected Objects.
Date: Tue, 31 Jan 2017 15:52:23 +0100
Date: 2017-01-31T15:52:23+01:00 [thread overview]
Message-ID: <o6q8b6$8b3$1@gioia.aioe.org> (raw)
In-Reply-To: 095bc904-c60a-4521-a1a2-8f8b095a4b53@googlegroups.com
On 31/01/2017 15:33, patrick@spellingbeewinnars.org wrote:
> If I have :
>
> var1
> var2
> var3
>
> task1
> task2
> task3
>
> and if each tasks only writes to it's variable, task1 -> var1
>
> then can the main thread read/write to var1 thru var3 without
> issues?
It cannot unless variables access is atomic (Pragma Atomic).
P.S. Atomic is a necessary but not sufficient exclusion requirement.
E.g. it is insufficient for incrementing shared variables.
P.P.S. See "monitor" (the access exclusion model suitable for Ada 83 tasks):
https://en.wikipedia.org/wiki/Monitor_(synchronization)
P.P.P.S. Protected objects are not superior to rendezvous. There are
cases when one model works better than another and conversely.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2017-01-31 14:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-31 14:33 Tasking without Protected Objects patrick
2017-01-31 14:52 ` Dmitry A. Kazakov [this message]
2017-01-31 16:47 ` J-P. Rosen
2017-01-31 16:53 ` Björn Lundin
2017-01-31 17:53 ` patrick
2017-01-31 17:40 ` Jeffrey R. Carter
2017-01-31 17:55 ` patrick
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox