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 X-Google-Attributes: gid103376,public From: cosc19z5@Bayou.UH.EDU (Spasmo) Subject: Re: Concurrency in Gnat 3.05? Date: 1996/07/24 Message-ID: <4t4l4s$m18@masala.cc.uh.edu>#1/1 X-Deja-AN: 170432467 references: <4sjqte$3mu@masala.cc.uh.edu> <4sr724$4k8@felix.seas.gwu.edu> organization: University of Houston newsgroups: comp.lang.ada Date: 1996-07-24T00:00:00+00:00 List-Id: Michael Feldman (mfeldman@seas.gwu.edu) wrote: : In article <4sjqte$3mu@masala.cc.uh.edu>, Spasmo wrote: : >Hey all. : > : >Is Gnat 3.05 (for DOS) truly concurrent when executing tasks? I'm : >asking because I've written some tasking code (finally got it : >to link) and when I ran the code, the tasks didn't run : >concurrently at all. I'm running in a Win95 DOS box. One task : >runs to completion before the other task starts up. I've also : >tried some sample code including Feldman's Twotasks program : >and they exhibit the same behavior. Is there a way to get : >tasks to run concurrently, or would I have to look for a : >GNAT that's native to something like WinNT/95 that can : >handle multi-tasking? : Hmmm - since you have access to my Two_Tasks program, you oughta try : Two_Cooperating_Tasks in the same distribution (or book) in which : DELAY is used to cause the tasks to cooperatively swap control. Well I've more or less got a grip on things and am implementing my own scheduling as folks suggested which is actually a blessing in disguise IMHO, but I'd love to see your Two_Cooperating_Tasks program indeed. I've got a subdirectory chock full of your stuff so I'll look for it imemdiately. : The term "multitasking" seems to be one of the least well understood : by the most people, especially in the Ada context. While I do understand multitasking I'm as guilty as they get for misusing that term in the most gruesome of ways. : _Preemptive_ multitasking is NOT required in the Ada 95 core language, : nor is time-slicing. At this point I know :). I just saw tasks and immediately a synapse fired and said "pre-emptive multi-tasking". I suppose the reason I assumed time slicing was because I had assumed that tasking was similar to the fork() system call in UNIX C. My mistake indeed! : Further, "truly" concurrent is possible only if you have : multiple processors. A typical single processor can execute only one : instruction at a time (maybe with some I/O overlap), so "true" concurrency : is simply not possible. _All_ concurrency on a single processor is : "logical" (sometimes called pseudo-) concurrency. Well "truly" is another gruesome error on my behalf. Why I even said "truly" I will never know, especially since I should know better. : Your question then can be re-phrased as, : "Will the OS, or the runtime system, manage my logical concurrency : automatically, or is it up to me to write cooperative tasks?" In Ada, : the answer is "sometimes." :-) Perfect! Hey maybe next time I'll just send you a poorly worded post and you can write it up for me :) : Mike Feldman -- Spasmo "Here's a present just for you When you open it, you'll be through" "Letter Bomb" by the Circle Jerks