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 04:12:07 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!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 13:12:05 +0100 Message-ID: References: <3DD3D841.CD16A4CB@canal-plus.fr> <8MCB9.8643$8o1.1371873@news.xtra.co.nz> <3DD8AEAC.241AD1F8@canal-plus.fr> 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 1037621525 17493584 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:31036 Date: 2002-11-18T13:12:05+01:00 List-Id: On Mon, 18 Nov 2002 10:11:08 +0100, Thierry Lelegard wrote: >No need to argue, just try the following program with and without >the "Free". If you find one Ada95 compiler one one platform where >it does not eat up all the memory, please let us know. > >With GNAT on Solaris, VMS, Linux, HP-UX and Windows, I already know >the answer... Alas. [Ooch, I will add your example to our compiler validation site] >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!] --- Regards, Dmitry Kazakov www.dmitry-kazakov.de