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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a6c65cbc407987fe X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-18 05:38:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: dynamic multithreading Date: Mon, 18 Nov 2002 14:38:08 +0100 Message-ID: <01rhtuogfhje1qq7r7o1c06nr1or8cnf4b@4ax.com> References: NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1037626688 17459170 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:31040 Date: 2002-11-18T14:38:08+01:00 List-Id: On Mon, 18 Nov 2002 13:13:28 +0100 (MET), "Grein, Christoph" 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