comp.lang.ada
 help / color / mirror / Atom feed
From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: Scheduling behaviour issue
Date: Wed, 22 Apr 2020 13:41:19 -0700 (PDT)
Date: 2020-04-22T13:41:19-07:00	[thread overview]
Message-ID: <c246151d-600a-4262-a7ee-e6233a344333@googlegroups.com> (raw)
In-Reply-To: <hgbf8aFcbk1U1@mid.individual.net>

Am Mittwoch, 22. April 2020 20:03:56 UTC+2 schrieb Niklas Holsti:
> Under RTEMS, if there are higher-priority tasks on that processor core, 
> such actions on shared data would not have this mutual-exclusion 
> property, and the shared data could be messed up. However, I'm not sure 
> if such use of shared data is "correct" per the Ada RM, and if the 
> resulting mess can be called "misbehaviour".

This is the reasoning of Ada 83 (RM 9.11 Shared Variables):

<quote>
For the actions performed by a program that uses shared variables, the following assumptions can always be made:

* If between two synchronization points of a task, this task reads a shared variable whose type is a scalar or access type, then the variable is not updated by any other task at any time between these two points.

* If between two synchronization points of a task, this task updates a shared variable whose type is a scalar or access type, then the variable is neither read nor updated by any other task at any time between these two points. 

The execution of the program is erroneous if any of these assumptions is violated.
</quote>

I'm too lazy to search for the relevant text in current Ada, but as far as I can tell, this principle is still valid. This is one of the reasons I guess that protected objects were introduced.

  reply	other threads:[~2020-04-22 20:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-22 11:34 Scheduling behaviour issue Simon Wright
2020-04-22 16:16 ` fabien.chouteau
2020-04-22 17:20   ` Simon Wright
2020-04-22 18:05     ` Anh Vo
2020-04-22 18:21       ` Niklas Holsti
2020-04-22 18:03 ` Niklas Holsti
2020-04-22 20:41   ` AdaMagica [this message]
2020-04-22 21:58     ` Niklas Holsti
2020-04-23  0:47       ` Jere
2020-04-23 10:56   ` Simon Wright
2020-04-23 12:38     ` Niklas Holsti
2020-04-23 12:57     ` Niklas Holsti
2020-04-23 11:48 ` Simon Wright
2020-04-23 13:18 ` Niklas Holsti
replies disabled

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