From: eachus@mitre-bedford.arpa (Robert I. Eachus)
Subject: Re: TEXT_IO & Tasks
Date: 2 Dec 92 00:15:30 GMT [thread overview]
Message-ID: <EACHUS.92Dec1191530@dr_no.mitre.org> (raw)
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...
reply other threads:[~1992-12-02 0:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox