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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6955eae2a99ef80,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!p39g2000hsb.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: No_Task_Termination and the main subprogram Date: Thu, 30 Oct 2008 06:39:48 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 128.141.45.219 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1225373989 30907 127.0.0.1 (30 Oct 2008 13:39:49 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 30 Oct 2008 13:39:49 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: p39g2000hsb.googlegroups.com; posting-host=128.141.45.219; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.3) Gecko/2008092414 Firefox/3.0.3,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:2531 Date: 2008-10-30T06:39:48-07:00 List-Id: Hi, I have a philosophical question related to No_Task_Termination restriction. It requires that tasks do not terminate and the common wisdom is that tasks in RT software usually have some infinite loop that satisfy this requirement. What about the environment task? Imagine a program where additional tasks are created at library level to handle some work and where the main subprogram is used to trigger initialization, configuration, etc. After doing everything, the main subprogram can: 1. Fall in an infinite loop to clearly show that it does not terminate. This is artificial. 2. Wait on some dummy condition that is never satisfied. This is even more artificial and can require setting up separate structures/objects/ etc. 3. Change the role and do some useful work that would normally be put in a separate task. This introduces arbitrary assymetry in the project, because one chosen work package is executed in the environment task whereas others run in their dedicated tasks. 4. Just finish, which means run off the end of the subprogram code, but without actually terminating the task. The environment task will never terminate anyway as it will implicitly wait for all other tasks (which will not terminate either, but there it is a clear outcome of their design). I find the last option the most clean, although it needs documenting that in fact the program is not going to terminate due to other tasks being still alive. What is your opinion about it? -- Maciej Sobczak * www.msobczak.com * www.inspirel.com Database Access Library for Ada: www.inspirel.com/soci-ada