comp.lang.ada
 help / color / mirror / Atom feed
* Re: TEXT_IO & Tasks
@ 1992-12-02  0:15 Robert I. Eachus
  0 siblings, 0 replies; only message in thread
From: Robert I. Eachus @ 1992-12-02  0:15 UTC (permalink / 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...

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1992-12-02  0:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1992-12-02  0:15 TEXT_IO & Tasks Robert I. Eachus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox