From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 2 Dec 92 00:15:30 GMT From: eachus@mitre-bedford.arpa (Robert I. Eachus) Subject: Re: TEXT_IO & Tasks Message-ID: List-Id: In article <722631342.16895@minster.york.ac.uk> mjl-b@minster.york.ac.uk writes : It is a reasonable assumption, but it depends on the implementation. Under Unix, TEXT_IO stuff usually ends up in a Unix I/O call. If the whole Ada program (i.e. all the tasks) is mapped onto one Unix process, then if that Unix call blocks, all the tasks will be blocked. This all tasks to one process mapping is the usual case, since mapping each task to a Unix process is extremely inefficient. There are two common solutions to this problem: 1) Do clever stuff with Unix select() (but this is non portable) 2) Map Ada tasks onto POSIX threads (or their equivalent in your Unix) And one (uncommon) solution that has the advantage that you can do it yourself when forced to... Have all Ada tasks within a single process but rewrite the IO packages to use separate Unix processes for all blocking actions. (Actually the one time I did it, I used three processes in TEXT_IO, one process each for STANDARD_IN and STANDARD_OUT and one for all other files, and one process for each instantiation of the other IO packages.) This also allowed me to have more than 20 files open files per program... -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...