Reputation: 691
With the "recent" changes to C and C++ adding memory models (similar to Java and C#), I was wondering whether Ada83 or Ada95 inbuilt support for concurrency also defined a memory model.
Does anybody know of any references about whether Ada defined a memory model?
Bonus question: was Ada83 the first general programming language to offer INBUILT support for shared-state concurrency?
Upvotes: 2
Views: 369
Reputation:
Regarding Tasking & Shared memory, I think you should be looking at Protected Types. For concurrency this allows different threads (tasks) to share a resource without the need for explicit mutexes.
Upvotes: 2
Reputation: 25501
I think the nearest to a memory model in the sense you're asking about is the Dynamic Semantics section of the ARM.
Ada 83 had pragma Shared.
Ada 95 replaced this with pragmas Atomic, Volatile, Atomic_Components, and Volatile_Components; Ada 2005 was the same with (in a Correction) pragmas Independent and Independent_Components (that is, the referenced object, or each of its components, is independently addressable).
Ada 2012 replaces the pragmas with aspects, for good but not immediately relevant reasons:
Imported_Variable : Integer with
Import, Convention => C, External_Name => "exported_variable", Volatile;
Upvotes: 5