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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1c3d4536a687b7b0 X-Google-Attributes: gid103376,public From: Richard Riehle Subject: Re: Ada 95 tasking problems with Ada 83 code Date: 2000/08/30 Message-ID: <39ADD3A3.381DEF17@ix.netcom.com>#1/1 X-Deja-AN: 664603442 Content-Transfer-Encoding: 7bit References: <39ADAE51.30550667@mtws.visicom.com> X-Accept-Language: en X-Server-Date: 31 Aug 2000 03:46:06 GMT Content-Type: text/plain; charset=us-ascii Organization: MindSpring Enterprises Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-08-31T03:46:06+00:00 List-Id: Wayne Lydecker wrote: > I am porting a huge program from Ada 83 on HP-UX to GNAT Ada 95 on a PC > running Linux. Creating the executable was not a big problem, but I > can't get it to run very far. It appears that when a procedure rendezvous' > with a task, the task won't run. The task has a simple accept statement, > and it appears to accept the rendezvous because the calling routine > continues to process. Text_IO calls before and after the accept statement > in the task fail to appear on the screen though. If I put a "do ... end" > on the accept statement then the caller no longer continues (i.e. > suspended). > > Is this a known problem? Is there a solution other then removing all > tasks in our program (over 100). > You mention the calls to Text_IO. This is a potential source of trouble in tasking, especially if you have any kind of Get or Get_Line statements. Recommend looking at Get_Immediate, and Look_Ahead as possible alternatives to other Get statements. The standard Get statement blocks waiting for input but Get_Immediate can get whatever is in the buffer without waiting for a CR/LF. This may not be the entire source of your problem. Although converting a task-based program from Ada 83 to Ada 95 is fairly straightforward, you can encounter other problems due to timing issues (sometimes people put delay statements into task-based programs), mutual exclusion problems (the use of task-based semaphores instead of protected objects), and other little gotchas that result in a compiled program that will not run as expected. Another possibility is schedulability. For example, are all the tasks at the same level of priority? Have you done a careful analysis of the schedulability of the design using RMA tools? With over 100 tasks, it is essential that you examine the schedulability issue using contemporary mathematical tools such as RMA. Do not automatically assume you must eliminate tasking from your program. Properly designed, tasking can work quite well and give your program a level of robust perfomance you might not otherwise be able to easily achieve. This is especially true of the Ada 95 tasking model. Richard Riehle