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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a02:158e:: with SMTP id 14-v6mr34792774jaq.18.1537525749434; Fri, 21 Sep 2018 03:29:09 -0700 (PDT) X-Received: by 2002:a9d:4049:: with SMTP id o9-v6mr376068oti.2.1537525749242; Fri, 21 Sep 2018 03:29:09 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.166.216.MISMATCH!x81-v6no38461ita.0!news-out.google.com!z5-v6ni59ite.0!nntp.google.com!x188-v6no38285ite.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 21 Sep 2018 03:29:08 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=176.10.164.41; posting-account=IWGXAgoAAAAN22gxH4FLrPfxoHPdumnx NNTP-Posting-Host: 176.10.164.41 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Watchdog-Timer Assignment From: Alex Injection-Date: Fri, 21 Sep 2018 10:29:09 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:54393 Date: 2018-09-21T03:29:08-07:00 List-Id: Hello, I have a school assignment (I have heard that this is important to m= ention) which I need help with. You can find my code here: https://ideone.com/LIWmJM My assignment is this: Modify F3 from Part 1 so that it occasionally takes more than 0.5 seconds t= o execute. Augment the cyclic scheduler from Part 1 with a watchdog task to monitor F3= 's execution time. When F3 exceeds its deadline (0.5s), the watchdog task s= hould immediately print a warning message. I.e., 0.5s after start of F3, ei= ther F3 has finished or the watchdog has printed a message. The watchdog sh= ould let F3 finish even if it misses its deadline. The watchdog task should be started (released) at the same time as (or just= before) F3 starts executing, and from that point measure the time that F3 = uses. When F3 misses its deadline the cyclic executive should re-synchronize so t= hat F1 is started at whole seconds. You should start with this skeleton code: part 2. Examine the code to under= stand how a task is declared inside an Ada program. Try to modify it in pla= ces indicated by the comments. You can also reuse your solution for part 1 = as the initial code. (P.S The skeleton code "part 2" is more or less an empty Watchdog task-body= ). I have implemented a random delay for f3 so that it occasionally takes more= than 0.5 seconds to execute. My biggest issue (I believe) is that (if f3 t= akes more than 0.5 seconds to execute) f1 is supposed to start over at the = next whole second. I dont know where I should put that delay for this to happen. Thank you in advance!