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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,899097ccdbca937b X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: Finalization of record components which are tasks Date: 2000/03/02 Message-ID: #1/1 X-Deja-AN: 592699348 Sender: rusfw@mercury.rus.uni-stuttgart.de References: Content-Type: text/plain; charset=us-ascii Organization: Comp.Center (RUS), U of Stuttgart, FRG Mime-Version: 1.0 User-Agent: Gnus/5.0804 (Gnus v5.8.4) Emacs/20.5 Newsgroups: comp.lang.ada Date: 2000-03-02T00:00:00+00:00 List-Id: > Does the termination of a task which is a component of a controlled > object really happen *before* the user-defined finalization subprogram > is called? This is really surprising. IMHO, both common sense and > 7.6.1(5) suggest that the task object has to be finalized *after* the > user-defined finalization subprogram has completed. I'm too lazy to read all your code, but maybe this will answer the question: A task terminates when it's done. Also, if it is waiting on a terminate alternative, it terminates when its master is done, and all of the other tasks dependent on that master are terminated or waiting on terminate alternatives. In particular, the termination of a task is *not* triggered by finalization of the task object. So 7.6.1(9) is irrelevant. When a master (eg a procedure) is done ("completed" is the RM term) it *first* awaits termination of dependent tasks (and/or causes their termination if they're waiting on terminate alts). It *then* finalizes all of the local objects (and if some of those are tasks, or contain tasks, then they are necessarily already terminated at that point). Note that finalization of a task object doesn't do much of anything. You wouldn't want it to be the other way around: If you first finalize locals, and then wait for the tasks to terminate, then those tasks would have the data they're working on ripped out from under them. There are obscure ways in which programs can see finalized objects, but this isn't one of them, and that's a good thing. - Bob