From: Dmitry A. Kazakov <mailbox@dmitry-kazakov.de>
Subject: Re: dynamic multithreading
Date: Mon, 18 Nov 2002 14:38:08 +0100
Date: 2002-11-18T14:38:08+01:00 [thread overview]
Message-ID: <01rhtuogfhje1qq7r7o1c06nr1or8cnf4b@4ax.com> (raw)
In-Reply-To: mailman.1037622003.28510.comp.lang.ada@ada.eu.org
On Mon, 18 Nov 2002 13:13:28 +0100 (MET), "Grein, Christoph"
<christoph.grein@eurocopter.com> wrote:
>> >with Ada.Text_IO;
>> >with Ada.Unchecked_Deallocation;
>> >with System;
>> >
>> >procedure Crazy_Tasks is
>> >
>> > task type T is
>> > pragma Priority (System.Priority'Last);
>> > entry Foo;
>> > end T;
>> >
>> > type Access_T is access T;
>> >
>> > task body T is
>> > begin
>> > select
>> > accept Foo;
>> > else
>> > null;
>> > end select;
>> > end T;
>> >
>> > procedure Free is new Ada.Unchecked_Deallocation (T, Access_T);
>> >
>> > type Counter is mod 2**32;
>> >
>> > Count : Counter := 0;
>> > TV : Access_T;
>> >
>> >begin
>> >
>> > loop
>> > TV := new T; -- should terminate immediately
>> > while not TV.all'Terminated loop
>> > delay 0.0;
>> > end loop;
>> > -- Free (TV);
>> > Count := Count + 1;
>> > if Count mod 50_000 = 0 then
>> > Ada.Text_IO.Put_Line (Counter'Image (Count) & " tasks");
>> > end if;
>> > end loop;
>> >
>> >end Crazy_Tasks;
>>
>> This does not leak in ObjectAda 7.2 under Windows. [Trumpets!]
>
>I do not understand... Even with Free commented out doesn't it leak?
Of course not. It does not leak when Free is called.
I thought that the poster meant that it will leak *no matter* whether
Free is called or not. If it would be the case, then I could
understand his argumentation for a task pool.
---
Regards,
Dmitry Kazakov
www.dmitry-kazakov.de
next prev parent reply other threads:[~2002-11-18 13:38 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-18 12:13 dynamic multithreading Grein, Christoph
2002-11-18 13:38 ` Dmitry A. Kazakov [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-11-19 6:49 Grein, Christoph
2002-11-20 18:20 ` Matthew Heaney
2002-11-27 15:55 ` John English
2002-11-19 6:46 Grein, Christoph
2002-11-19 6:38 Grein, Christoph
2002-11-19 9:13 ` Lutz Donnerhacke
2002-11-19 5:28 Grein, Christoph
2002-11-18 9:22 Grein, Christoph
2002-11-18 12:25 ` Thierry Lelegard
2002-11-18 13:32 ` Dmitry A. Kazakov
2002-11-18 16:20 ` Pascal Obry
2002-11-14 13:12 Artiom Ivanov
2002-11-14 13:49 ` David Marceau
2002-11-14 14:14 ` Björn Lundin
2002-11-14 17:07 ` Thierry Lelegard
2002-11-14 18:59 ` tmoran
2002-11-14 22:04 ` Robert A Duff
2002-11-15 9:27 ` Jean-Pierre Rosen
2002-11-17 23:02 ` AG
2002-11-17 5:17 ` tmoran
2002-11-17 12:40 ` Simon Wright
2002-11-18 9:11 ` Thierry Lelegard
2002-11-18 12:12 ` Dmitry A. Kazakov
2002-11-18 16:18 ` Pascal Obry
2002-11-18 16:25 ` Lutz Donnerhacke
2002-11-18 16:21 ` Simon Wright
2002-11-19 9:03 ` Lutz Donnerhacke
2002-11-19 21:41 ` Simon Wright
2002-11-18 16:28 ` Preben Randhol
2002-11-18 16:30 ` Lutz Donnerhacke
2002-11-18 16:35 ` Preben Randhol
2002-11-18 16:44 ` Lutz Donnerhacke
2002-11-18 18:58 ` Preben Randhol
2002-11-19 9:09 ` Lutz Donnerhacke
2002-11-18 19:00 ` Preben Randhol
2002-11-19 9:11 ` Lutz Donnerhacke
2002-11-19 9:32 ` Preben Randhol
2002-11-19 11:18 ` Lutz Donnerhacke
2002-11-19 12:42 ` Georg Bauhaus
2002-11-19 9:00 ` Dmitry A. Kazakov
2002-11-18 14:30 ` Stephen Leake
2002-11-18 17:41 ` David C. Hoos
2002-11-14 14:29 ` David C. Hoos
2002-11-14 18:37 ` Jeffrey Carter
2002-11-14 22:03 ` Robert A Duff
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox