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: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: Concurrency in Gnat 3.05? Date: 1996/07/18 Message-ID: #1/1 X-Deja-AN: 168766109 references: <4sjqte$3mu@masala.cc.uh.edu> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-07-18T00:00:00+00:00 List-Id: Spasmo said Ok, before I get on with my main question, I've got another. Is there any place where I can find some detailed GNAT specific docs? I know my questions are simple newbie ones that could be answered given some detailed GNAT docs, however all the docs I have seem to be about installation, or DJGPP, so I end up wasting bandwidth asking newbie questions because I can't seem to find the answers anywhere. Well on to my next newbie question :) The current documentation is gnatinfo.txt, which I assume you have read since it is included in all GNAT releases. If not, you have completely missed the primary available documentation! 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? Of course it is not truly concurrent, there is no such thing as true concurrency on a monoprocessor! The processor can only do one thing at a time! What you are asking is whether it time slices among equal priority tasks, and the answer is that it does not, and that Ada 95 dispatching semantics does not permit time slicing in its default: The following is from RM annex D. 4 Task dispatching is the process by which one ready task is selected for execution on a processor. This selection is done at certain points during the execution of a task called task dispatching points. A task reaches a task dispatching point whenever it becomes blocked, and whenever it becomes ready. In addition, the completion of an accept_statement (see 9.5.2), and task termination are task dispatching points for the executing task. Other task dispatching points are defined throughout this Annex. Time slicing is available when GNAT runs over some operating systems where tasks are mapped to threads, and the threads provide time slicing (whether this conforms to annex D is an interesting question .. it certainly does not conform to the spirit of annex D, but you can argue that you are simulating the effect of a multi-processor. In any case, the bottom line is that tasks do NOT time slice on DOS, and any Ada program that depends on time slicing is not portable, and is depending on implementation specific alternative scheduling policies.