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-Received: by 2002:a5e:c30b:: with SMTP id a11-v6mr368205iok.38.1537583644851; Fri, 21 Sep 2018 19:34:04 -0700 (PDT) X-Received: by 2002:aca:af15:: with SMTP id y21-v6mr3537oie.6.1537583644689; Fri, 21 Sep 2018 19:34:04 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!paganini.bofh.team!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!x81-v6no135471ita.0!news-out.google.com!c63-v6ni153ith.0!nntp.google.com!x188-v6no134500ite.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 21 Sep 2018 19:34:04 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=24.6.20.197; posting-account=Qh2kiQoAAADpCLlhT_KTYoGO8dU3n4I6 NNTP-Posting-Host: 24.6.20.197 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <624734c8-0cca-4d4d-bedf-ee61428c235a@googlegroups.com> Subject: Re: Watchdog-Timer Assignment From: Anh Vo Injection-Date: Sat, 22 Sep 2018 02:34:04 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:54401 Date: 2018-09-21T19:34:04-07:00 List-Id: On Friday, September 21, 2018 at 3:29:10 AM UTC-7, Alex wrote: > Hello, I have a school assignment (I have heard that this is important to= mention) which I need help with. >=20 > You can find my code here: https://ideone.com/LIWmJM >=20 > My assignment is this: >=20 > Modify F3 from Part 1 so that it occasionally takes more than 0.5 seconds= to execute. >=20 > 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= should immediately print a warning message. I.e., 0.5s after start of F3, = either F3 has finished or the watchdog has printed a message. The watchdog = should let F3 finish even if it misses its deadline. >=20 > The watchdog task should be started (released) at the same time as (or ju= st before) F3 starts executing, and from that point measure the time that F= 3 uses. >=20 > When F3 misses its deadline the cyclic executive should re-synchronize so= that F1 is started at whole seconds. >=20 > You should start with this skeleton code: part 2. Examine the code to und= erstand how a task is declared inside an Ada program. Try to modify it in p= laces indicated by the comments. You can also reuse your solution for part = 1 as the initial code. >=20 > (P.S The skeleton code "part 2" is more or less an empty Watchdog task-bo= dy). >=20 > I have implemented a random delay for f3 so that it occasionally takes mo= re than 0.5 seconds to execute. My biggest issue (I believe) is that (if f3= takes more than 0.5 seconds to execute) f1 is supposed to start over at th= e next whole second. >=20 > I dont know where I should put that delay for this to happen. >=20 > Thank you in advance! I looked at your codes. I did not know exactly what you meant by "part 1" a= nd "Part 2".=20 Anh Vo