From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Class with task destructor
Date: Thu, 1 Dec 2011 18:57:22 -0600
Date: 2011-12-01T18:57:22-06:00 [thread overview]
Message-ID: <jb97pk$bvb$1@munin.nbi.dk> (raw)
In-Reply-To: wccliqwdku1.fsf@shell01.TheWorld.com
"Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message
news:wccliqwdku1.fsf@shell01.TheWorld.com...
> "J-P. Rosen" <rosen@adalog.fr> writes:
>
>> Put an entry (say "Termination_Wait") in the waited task, and never
>> accept it. Call Termination_Wait from the waiting task. When the waiting
>> task receives Tasking_Error, the waited task is terminated (well,
>> completed, but that should be close enough).
>
> I don't think it's close enough. It is impossible to actually
> free things before the task is really terminated. The task is
> doing finalization between completion and termination, and that
> could refer to discriminants. And even if there's no finalization
> present, the task is still using its stack, which had better not
> be freed.
I agree, but I note that J-P's suggestion at least provides a way to delay
polling until the task is completed. Most tasks don't have complex
finalization, so they don't have to stay for a long time in the completed
state. (Although I'd have to go look up the exact details as to when a
completed task becomes terminated.
I'll note that I became aware of this need to poll for 'Terminated because
of various bug reports on ACATS tests involving tasks. Several of them had
to be fixed by adding such polling before checking the results of the test.
(And a lot of them already had such polling.) It's hard to avoid in Ada as
it stands.
Randy.
next prev parent reply other threads:[~2011-12-02 0:58 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-23 1:50 Class with task destructor Rego, P.
2011-11-23 2:44 ` Adam Beneschan
2011-11-23 5:04 ` Yannick Duchêne (Hibou57)
2011-11-23 6:14 ` Adam Beneschan
2011-11-24 0:15 ` Randy Brukardt
2011-11-24 2:48 ` Adam Beneschan
2011-11-29 3:36 ` Randy Brukardt
2011-11-29 9:31 ` Simon Wright
2011-11-29 15:37 ` Adam Beneschan
2011-11-23 8:35 ` Dmitry A. Kazakov
2011-11-23 9:05 ` Simon Wright
2011-11-23 10:41 ` Dmitry A. Kazakov
2011-11-30 1:11 ` Rego, P.
2011-11-30 2:21 ` Adam Beneschan
2011-11-30 8:41 ` Dmitry A. Kazakov
2011-12-01 0:35 ` Randy Brukardt
2011-12-01 6:28 ` J-P. Rosen
2011-12-01 10:55 ` Simon Wright
2011-12-01 21:48 ` Robert A Duff
2011-12-01 22:44 ` Adam Beneschan
2011-12-02 0:57 ` Randy Brukardt [this message]
2011-12-02 5:57 ` J-P. Rosen
2011-12-02 15:07 ` Robert A Duff
2011-12-02 18:41 ` Jeffrey Carter
2011-12-01 9:25 ` Dmitry A. Kazakov
2011-12-01 1:58 ` Rego, P.
2011-11-30 8:35 ` Simon Wright
2011-11-30 15:36 ` Adam Beneschan
2011-11-30 16:32 ` Robert A Duff
2011-12-01 0:40 ` Randy Brukardt
2011-12-01 8:50 ` Yannick Duchêne (Hibou57)
2011-12-02 0:50 ` Randy Brukardt
2011-12-02 5:30 ` Jeffrey Carter
2011-12-02 16:20 ` Adam Beneschan
2011-12-02 18:01 ` Dmitry A. Kazakov
2011-12-02 18:50 ` Jeffrey Carter
2011-12-02 19:03 ` Adam Beneschan
2011-12-01 10:51 ` Simon Wright
2011-12-01 22:59 ` Simon Wright
2011-12-01 1:59 ` Rego, P.
2011-11-30 1:47 ` Rego, P.
[not found] ` <15090042.1880.1322617401962.JavaMail.geo-discussion-forums@yqkn8>
2011-11-30 8:43 ` Dmitry A. Kazakov
2011-12-01 1:53 ` Rego, P.
2011-12-01 9:28 ` Dmitry A. Kazakov
2011-11-25 2:44 ` Rego, P.
[not found] ` <28489797.1088.1322188495508.JavaMail.geo-discussion-forums@yqf20>
2011-11-25 9:19 ` Dmitry A. Kazakov
2011-11-29 3:40 ` Randy Brukardt
2011-11-23 10:26 ` Brian Drummond
2011-11-25 1:37 ` Rego, P.
2011-11-25 13:40 ` Brian Drummond
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox