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,9e46e8a19dc8e224 X-Google-Attributes: gid103376,public From: ohk@edeber.nta.no (Ole-Hjalmar Kristensen FOU.TD/DELAB) Subject: Re: Asynchronous IO Date: 1996/06/17 Message-ID: #1/1 X-Deja-AN: 160586426 references: organization: Telenor R&D newsgroups: comp.lang.ada Date: 1996-06-17T00:00:00+00:00 List-Id: In article dewar@cs.nyu.edu (Robert Dewar) writes: Kristensen said "For obvious resons, it is desirable to be able to do output of data to different devices in parallel. Does the Ada95 standard define what happens if two tasks try to do IO to two different files at the same time? I have tried to find out by reading both the RM and the Rationale, but is none the wiser." For obvious reasons, it is impossible to find the answer in the RM, since it depends on the implementation. On a system like DOS, which does not provide multi-threaded I/O, of course any I/O operation is likely to block other tasks (sometimes a kludge for keyboard I/O can be arranged, using polling). Yes, I also came to this conclusion some time after having posted my question. I can only say I havn't programmed on systems like DOS fo a LONG time... On systems that do provide multi-threaded I/O, you still have to find out if your implementation takes advantage of this. Take a system like Solaris, one could do the Ada tasking within one Solaris thread, which would in fact likely be the most efficient approach for the Ada tasking itself. However, you would then not get overlapped I/O. One of the reasons that most people want tasks to map to threads in a system like Solaris, is precisely to get overlapped I/O, though you then have to check that the system provides thread-safe I/O (it is amazing in modern Unix systems with threads how much is NOT thread safe, for instance, malloc is not thread safe in Solaris). I suppose the most reasonable way to make a program using overlapped IO portable then, would be to define a package to do it, and change its implementation depending on what kind of system you are running on. Ole-Hj, Kristensen