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.9 required=5.0 tests=BAYES_00 autolearn=ham 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/19 Message-ID: <4snim3$5pr@masala.cc.uh.edu> X-Deja-AN: 168842191 references: <4sjqte$3mu@masala.cc.uh.edu> organization: University of Houston newsgroups: comp.lang.ada Date: 1996-07-19T00:00:00+00:00 List-Id: Robert Dewar (dewar@cs.nyu.edu) wrote: : 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! The sad thing is that I for some reason can't find this file in my installation! Probably my fault as usual, but my latest screwup is a doozy! I'll see about re-leeching some of the files to my shell account and extracting the gnatinfo from there and downloading. : 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. *Nod*, I managed to pick a really bad choice of words to describe what I meant. What I did mean is time slicing, interleaving task execution times, etc... Sorta like on Linux with separate processes and the like. : 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. Ok gotcha. : 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. Well I've sorta resigned myself to that fact, but it doesn't bug me too much because in a way this is kinda good. I mean for the stuff I'm currently trying to write, time slicing isn't all that meaningful, but making certain chunks of code "atomic" is, and so using entry points that encapsulate those portions enables me to interleave tasks based on units of work which for me is more sensible and as you state above it would be more portable, not that this program is anywhere near portable :). (You should see how many conio functions I'm importing for this baby, heheheeh). Thanks for everyone who contributed this thread and my apologies for my abuse of the above terminology. -- Spasmo "Here's a present just for you When you open it, you'll be through" "Letter Bomb" by the Circle Jerks