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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,3cfaa627fc3366de X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Task origin track from a class Date: Wed, 13 Jul 2011 13:59:13 +0200 Organization: cbb software GmbH Message-ID: References: <4o0rnqqqec1s$.19h46xsbjbku2.dlg@40tude.net> <024dd037-7c8f-460a-8ec4-0bf2456435ee@fq4g2000vbb.googlegroups.com> <13h82glc3htf0.1sjzw91gfndbf$.dlg@40tude.net> <4e1d5aa3$0$6544$9b4e6d93@newsspool4.arcor-online.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news1.google.com comp.lang.ada:20191 Date: 2011-07-13T13:59:13+02:00 List-Id: On Wed, 13 Jul 2011 10:43:15 +0200, Georg Bauhaus wrote: > On 7/13/11 9:41 AM, Dmitry A. Kazakov wrote: >> On Tue, 12 Jul 2011 17:36:29 -0700 (PDT), Shark8 wrote: >> >> The actual problems are: >> >> 1. The procedure of destruction of the objects having task components. >> Tasks are completed *before* Finalize is called. Ada's approach to >> construction/destruction is very much broken. > > When the life time of objects is determined by Ada's > language rules (and not by the type system), isn't it > normal to expect that the language defined wrecking > ball smashes the thing only after it has finished? Finalize is expected to have the object fully operational if called for the first time. Which is not the case for the task components. > What would be the alternative? Would it be that the > programmer then has to actively manage all parts of > destruction himself? Not at all. The alternative is for the user-defined constructor/destructor's hook to meet all components valid when called. Finalize is not such a hook. > When an implementation collects garbage, when would > the "destructor" run? The destructor of the type T to be called before the memory allocated for the object loses its attribution to the type T. Note that this does not imply deallocation. For instance when S is demoted to its base type T, the destructor of S must be called to make a T out of S. > Do finalization and RAII destruction(?) > have to be separate things? Finalization is another word for destruction. (I am not a language lawyer and don't about what RM might say about it) Again, observe that promotion requires a partial construction while demotion does a partial destruction. The primitive operation Finalize is a partial destructor. A complete destruction includes the bodies of the Finalize from all bases and destructors of all components. Note also that a consistent model must also provide hooks for promotion/demotion to the class (e.g. S -> T'Class, T'Class -> S). -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de