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: mfeldman@seas.gwu.edu (Michael Feldman) Subject: Re: Concurrency in Gnat 3.05? Date: 1996/07/20 Message-ID: <4sr724$4k8@felix.seas.gwu.edu>#1/1 X-Deja-AN: 169051261 references: <4sjqte$3mu@masala.cc.uh.edu> organization: George Washington University newsgroups: comp.lang.ada Date: 1996-07-20T00:00:00+00:00 List-Id: 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. The term "multitasking" seems to be one of the least well understood by the most people, especially in the Ada context. _Preemptive_ multitasking is NOT required in the Ada 95 core language, nor is time-slicing. 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. 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." :-) Mike Feldman