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.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!pt.cs.cmu.edu!sei!ajpo!rracine From: rracine@ajpo.sei.cmu.edu (Roger Racine) Newsgroups: comp.lang.ada Subject: Re: The ADA Rendevous Message-ID: <561@ajpo.sei.cmu.edu> Date: 25 Aug 89 20:48:06 GMT References: <3567@wpi.wpi.edu> Reply-To: rracine@ajpo.sei.cmu.edu (Roger Racine) Distribution: usa Organization: C.S. Draper Lab. List-Id: In article <3567@wpi.wpi.edu> tfrancis@wpi.wpi.edu (Krishan M Nainani) writes: > > There are many tasks each with 1 entry and these tasks are scheduled >by calling a global scheduler from inside the entry call. So, initially any >task is chosen and its entry is accepted and somewhere within the entry there >is a call to the scheduler (which is global to these tasks). Next, the >scheduler checks a data-structure which contains the varying importances of >each task and then it executes that task's entry. This can be done. > >But I am unsure as to how I can encode the following restriction which is >illustrated in the following example: > > Task A was chosen to run and so it was entered at entry point AA. >Within the code of AA, there was a call to the scheduler which found that >task B is more important than task A and so task A should be suspended and >task B is entered at entry point BB. Within BB, there was a call to the >scheduler which determined that task C (entry CC) should now run. Within CC, >it was found that task A (entry AA) is the most important and should be run >now. HOWEVER, task A should be resumed at where it left off (i.e where it was >suspended). THIS IS THE PART THAT I DON'T KNOW HOW TO ENCODE IN ADA. > This seems to involve manipulating the global task queue at runtime. >I doubt if I can do this in standard Ada but is it possible to accomplish >this by interfacing to C (not Assembler) . What would you like to interface to? The task scheduler? I do not know if the vendors give you access to that unless you have the source to the runtime system. If you do not, ask the vendor if there is a way to interface to their RTS. Better yet, ask them to implement dynamic priorities (which seems to be what you really want). If you have the source, the best thing to do would be to implement dynamic priorities (this is fairly easy, since it must already exist for rendezvous. All you have to do is get it visible). After you have dynamic priorities, be sure NOT to use the normal Ada pragma PRIORITY (those priority values are supposed to be static) for the tasks which need to have their priority values changed. The scheduler would then just modify the priorities (it being run at the highest priority) and return to the caller. The task scheduler would handle the rest. By the way, the SIGAda Ada RunTime Environment Working Group (ARTEWG) has a document called the Catalog of Implementation Features and Options which contains an interface definition for this, if you want at least some semblance of standardization. If you are interested, I would be glad to forward a request for the document to the chairman of the ARTEWG. By the way (again), why would you think that C could interface to an Ada scheduler easier than Ada? Are you using a product with a C RTS? Good luck. Roger Racine C.S. Draper Lab. rracine@ajpo.sei.cmu.edu