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,83e2886f2be41271 X-Google-Attributes: gid103376,public From: mfeldman@seas.gwu.edu (Michael Feldman) Subject: Re: Tasks in Gnat3.05 for Dos? Date: 1996/07/21 Message-ID: <4sun50$qdd@felix.seas.gwu.edu>#1/1 X-Deja-AN: 169956829 references: <4sev09$dik@masala.cc.uh.edu> <4sjtvr$42n@masala.cc.uh.edu> <4su2km$dt4@masala.cc.uh.edu> organization: George Washington University newsgroups: comp.lang.ada Date: 1996-07-21T00:00:00+00:00 List-Id: In article <4su2km$dt4@masala.cc.uh.edu>, Spasmo wrote: >Timeslicing. IN any case that's not to be as many folks have told >me, and now that I've started working on some tasking code, I find >that it's actually a good thing since it's better that I implement >my own atomic slicing based on units of work via different entries. Yes, I think you'll end up writing better concurrent programs that way. They will be independent of the underlying RT and OS dispatching, and that sort of program is just one of the key things Ada's high-level tasking constructs were designed for. And writing that sort of platform-independent concurrent program in C, say, is very difficult, nigh-on impossible, in the current state of threads implementations. At some point, POSIX threads may make this easier. In the meantime, note that GNAT tasking is implemented over whatever threads library is available, which means a bunch of system-independent stuff in the runtime. Aren't you glad all that threads stuff is taken care of by the GNAT runtime, instead of your having to write it yourself, program by program? * * * * * Allow me one anecdote. I recently finished teaching a course in which the semester project was to develop a software simulation for a part of a rapid transit system such as the Washington area's Metrorail. (Metrorail really does operate under automatic control, BTW.) I set an overall goal of developing a nice object model for trains, tracks, stations, control points, etc., and students were to exploit the platform-independent tasking model to the greatest extent possible. One especially nice 2-person project used a character-based display, and drew a rough map of the rail ines at the top, with little scrolling windows at the bottom to give status reports on the movements of the trains. This project was full of tasks and protected types. The students developed this on Solaris. After the course was over, I decided to download their code and use it as a shakedown of tasking on DOS, which had just been completed. It compiled and ran the first time, without changing a single character of source code! Two weeks ago I got _really_ bold, and decided to try out the tasking using the GNAT-MachTen for Mac. Tasking had just been (mostly) completed. Yep, the Metrorail project compiled and ran the first time, again without changing a single character of source code. I was extremely pleased, though not terribly surprised, because over the last ten years I've really come to appreciate the power of the Ada "concurrent object" model, and how easy it is to write really platform-independent concurrent programs. If anyone is interested, I just put a paper on the Metrorail project on the Web at http://www.seas.gwu.edu/seas/eecs/Research/ada/metro/metro.html Comments welcome. Mike Feldman