From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b8b8a54001adc4d2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Vinzent 'Gadget' Hoefler Newsgroups: comp.lang.ada Subject: Re: Possible Ada deficiency? Date: Tue, 11 Jan 2005 13:57:13 +0000 Message-ID: <2079224.1WssEAdSMv@jellix.jlfencey.com> References: <1104516913.718856.94090@z14g2000cwz.googlegroups.com> <16jm4u4b7j5bh.5r4falzh3k6a$.dlg@40tude.net> <9ls4dpw9xkri$.1t4b3d8zglukq.dlg@40tude.net> <2106909.XdsyxhICSC@jellix.jlfencey.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: individual.net iloLLw8ntN4Qblfd9zvM0QI3me1G1G+xao2dV+DIa3or1T5ePW X-Phone: +41 62 961 13 52 Xref: g2news1.google.com comp.lang.ada:7641 Date: 2005-01-11T13:57:13+00:00 List-Id: Dmitry A. Kazakov wrote: > On Tue, 11 Jan 2005 07:24:10 +0000, Vinzent 'Gadget' Hoefler wrote: > >> Dmitry A. Kazakov wrote: >> >>> I would leave all optimization issues to the compiler. >> >> Hmm. Then: What about pragma Volatile? pragma Atomic? > > Atomic and volatile are not about optimization. They describe a > contract. It is wrong to use pragmas for them. Maybe in C++, which > does not deal with concurrency it would be appropriate, but definitely > not in Ada. It is clear why these pragmas appeared. Atomic and/or Volatile are not necessarily about concurrency. Sometimes they are just about hardware. > With full ADT an "atomic Integer" will implement abstract protected > object. No need in any pragmas! Hmm. So instead of | type Timer_Mode is | record | BCD : Count; | CM : Count_Mode; | RWM : Read_Write_Mode; | SC : Counter_Select; | end record; | [aspect clauses] | pragma Atomic (Timer_Mode); you'd like to write | type Timer_Mode is | atomic record | [...] ? Hmm. >> Or all these interesting ones from Annexes D, E & H? > > It depends on each concrete case. Remote_Call_Interface? Interrupt_Priority? Attach_Handler? Inspection_Point? Vinzent.