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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Xref: utzoo comp.lang.c++:12929 comp.lang.ada:5269 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!cernvax!chx400!chx400!sicsun!disuns2!elcgl.epfl.ch!madmats From: madmats@elcgl.epfl.ch Newsgroups: comp.lang.c++,comp.lang.ada Subject: Re: Hiding Concurrency Message-ID: <1991Apr16.162828.1@elcgl.epfl.ch> Date: 16 Apr 91 15:28:28 GMT References: <1991Apr15.211346.15760@cs.odu.edu> Sender: news@disuns2.epfl.ch Followup-To: comp.lang.c++ Organization: Ecole Polytechnique Federale de Lausanne List-Id: In article <1991Apr15.211346.15760@cs.odu.edu>, zeil@cs.odu.edu (Steven J. Zeil) writes: > > My conclusion is that hiding concurrency control among operations with > "in out" parameters behind a procedural interface is generally > "erroneous" (in the sense that LRM 6.2.7 declares all program > executions erroneous whose "effect depends on which [parameter > passing] mechanism is selected by the implementation.") > Yes, you are absolutely right. Using semaphores embedded within ADTs is erroneous because it depends on the parameter passing mechanism selected by the implementation. This makes all of Booch's concurrent components erroneous. A recent paper in Ada Letters has already shown that problem: [Gonzales 90] Dean W. Gonzales, "Multitasking Software Components", Ada Letters Vol. X, No. 2, January/February 1990. The best solution I can imagine to that problem is to put all data implementing the ADT into a task and access it through entries, one for each operation. The problem with this solution, however, is that entries are not enough for specifying all operations you need on your ADT: entries cannot be functions and cannot be generic, which makes it difficult to write iterators. I am currently working on extensions to the Ada language that should solve this problem: I will propose a package type construct equivalent to the task type construct, which I will enhance so that it can include generic entries. Package and task types would then be equivalent except for concurrency. Then, through inheritance, a package implementing a non-concurrent ADT can be made into a concurrent one with minimal change. Mats Weber Swiss Federal Institute of Technology EPFL DI LGL 1015 Lausanne Switzerland E-mail : madmats@elcgl.epfl.ch phone : +41 21 693 52 92 fax : +41 21 693 39 09