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,ab2ba9c5d12b0f12,start X-Google-Attributes: gid103376,public From: Samuel Tardieu Subject: Re: Concurrency in Gnat 3.05? Date: 1996/07/18 Message-ID: #1/1 X-Deja-AN: 168675875 sender: tardieu@gargantua.enst.fr references: <4sjqte$3mu@masala.cc.uh.edu> to: cosc19z5@Bayou.UH.EDU (Spasmo) content-type: text/plain; charset=iso-8859-1 organization: TELECOM Paris mime-version: 1.0 newsgroups: comp.lang.ada Date: 1996-07-18T00:00:00+00:00 List-Id: >>>>> "Spasmo" == Spasmo writes: Spasmo> Is there any place where I can find some detailed GNAT Spasmo> specific docs? I know my questions are simple newbie ones that Spasmo> could be answered given some detailed GNAT docs, however all Spasmo> the docs I have seem to be about installation, or DJGPP, so I Spasmo> end up wasting bandwidth asking newbie questions because I Spasmo> can't seem to find the answers anywhere. In the GNAT distribution, there should be a file called gnatinfo.txt. In this file, you should find everything you want and even much more :-) Spasmo> Is Gnat 3.05 (for DOS) truly concurrent when executing tasks? AFAIK it's not, but there is nothing in the RM that requires it ! Spasmo> I'm asking because I've written some tasking code (finally got Spasmo> it to link) and when I ran the code, the tasks didn't run Spasmo> concurrently at all. Have you tried to use priorities ? Spasmo> I'm running in a Win95 DOS box. One task runs to completion Spasmo> before the other task starts up. That's common when you have a monoprocessor. If you need one of your task to be more "reactive", you may increase its priority (assuming it won't hog your whole CPU power). Spasmo> I've also tried some sample code including Feldman's Twotasks Spasmo> program and they exhibit the same behavior. Is there a way to Spasmo> get tasks to run concurrently, or would I have to look for a Spasmo> GNAT that's native to something like WinNT/95 that can handle Spasmo> multi-tasking? Once again, multitasking doesn't imply time-sharing between same-priority tasks. You may have true multitasking with no time-sharing. Anyway, as long as you have preemptive tasking, you may achieve what you are trying to do by adding a task running at an higher priority and waking up every microseconds to give one of your two task a priority highest than the second one. Example: let's assume you have two tasks T1 and T2, running at the same priority level L. You want to do time-sharing between these two tasks. You add a task S (scheduler) running at priority L+2, which "delay"s for microseconds then sets the priority of T1 to L+1 and the one of T2 to L (and vice-versa each two times), and then delays again, ... This way, your two tasks T1 and T2 run concurrently. Sam -- "La cervelle des petits enfants, ca doit avoir comme un petit gout de noisette" Charles Baudelaire