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,bc90e355ba0a1f8f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-07 13:51:01 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.litech.org!news.ems.psu.edu!news.aset.psu.edu!not-for-mail From: Robert Spooner Newsgroups: comp.lang.ada Subject: Re: Ada multi-threaded programs do not terminate under RedHat Linux Date: Fri, 07 Nov 2003 16:45:53 -0500 Organization: Penn State University, Center for Academic Computing Message-ID: <3FAC1291.7020305@psu.edu> References: <43f0a81.0311071228.6620c6c2@posting.google.com> NNTP-Posting-Host: nat3.arl.psu.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: f04n12.cac.psu.edu 1068241554 41204 128.118.40.78 (7 Nov 2003 21:45:54 GMT) X-Complaints-To: usenet@ NNTP-Posting-Date: Fri, 7 Nov 2003 21:45:54 +0000 (UTC) To: Ruben Stranders User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en,de,fr-FR In-Reply-To: <43f0a81.0311071228.6620c6c2@posting.google.com> Xref: archiver1.google.com comp.lang.ada:2233 Date: 2003-11-07T16:45:53-05:00 List-Id: Ruben, With the addition of: with Ada.Text_IO; use Ada.Text_IO; at the beginning, it compiles and runs OK using the latest public version of GNAT on Win2K. I don't have a linux machine to try. Bob Ruben Stranders wrote: > I'm a Ada newbie and I have to make a very simple program to > demonstrate the use of multithreading in Ada. For that purpose, I > created the following program. > > ============================ > procedure test is > task type counter; > > task body counter is > i : integer :=0; > begin > put_line("Start"); > while i < 10000 loop > i := i + 1; > end loop; > put_line("Finish"); > end; > > task1 : counter; > > begin > put_line("Test"); > end; > ============================ > > I've compiled it under RedHat Linux 9.0 with "gnatmake test.adb". > Unfortunately, the resulting program doesn't terminate. Instead of the > expected output: > > Starting > Finished > Test > > it only prints the first two lines. The body of the procedure "test" > is never called. I've tried this with several other programs and on > different machines (all with RedHat 9.0). Can anyone give me a > pointer? > > Regards, > > Ruben -- Robert L. Spooner Registered Professional Engineer Associate Research Engineer Intelligent Control Systems Department Applied Research Laboratory Phone: (814) 863-4120 The Pennsylvania State University FAX: (814) 863-7841 P. O. Box 30 State College, PA 16804-0030 rls19@psu.edu