comp.lang.ada
 help / color / mirror / Atom feed
From: James Hopper <hopperj@dayton.saic.com>
Subject: Re: Ada & UNIX
Date: 27 Sep 1994 13:49:29 GMT
Date: 1994-09-27T13:49:29+00:00	[thread overview]
Message-ID: <3697ta$isq@dayuc.dayton.saic.com> (raw)
In-Reply-To: Cwr188.J6C@freenet.carleton.ca



>I have a some concerns regarding Ada programming under UNIX.
>I would appreciate any feedback from any of you gurus out there.


Scott,

I can only answer for the SGI MP ada as thats what i have used, but i 
understand that mp ada exists for sun now as well. My knowledge of
unix systems is limited to my current project as well.

>1. How do Ada tasks and Unix processes co-exist?
On the sgi ada tasks, threads, light weight processes seem to be one and
the same.
ada tasks can be assigned to an SPROC which appears to be the same as a
unix
process. at least when i do a ps (show processes) on the console i see an
entry for each sproc i generate.

>2. How do Ada tasks behave when interacting with Unix utilities?
>   For example, do serial inputs suspend an Ada task or a Unix process?
kind of depends does it block in c? if not it probably does not in Ada
Using the MP threads/SPROC concept if i do blocking io, the sproc is hung
but i have the option of allowing the ada task to float from sproc to
sproc
so while the task doing the io may hang, other tasks can float to another
sproc assigned to the cpu and continue to execute.

>3. How can mutual exclusion over data be implemented between Ada tasks
and
>   Unix processes?
In SGI MP ada you have full access to semiphores, mutexes, etc, and they
interact just fine with unix processes.

>4. How do Ada subprograms interface with Unix processes?  For example,
Unix
>   pipes and streams are often used in C programs.  How are these
accessed
>   from Ada?  Should they be?
I havent done this so i cant say how its done, but there are people on my
project
doing it and they are pleased with its performance.  I belive they are
using
ada bindings to the c code.

>5. How do Ada task priorities and Unix process priorities interact?
when i create an SPROC i assign the unix process priority to the sproc. 
i can 
assign ada tasks to run on this sproc where the ada priority is used to 
control priority within the process.

>6. What can make Ada tasks and Unix processes behave
non-deterministically in
>   space or time?
On the sgi you can lock unix, interrupts, and the clock onto a single
processor
of our multiprocessor system so these do not interrupt the ada tasks.  in
addition
you can turn the unix scheduler off and do other things to make your code
more deterministic.  Test that i ran this summer however indicated this
is not
perfect, there were still some small indetermanacy on the order of as
much as
half a millisecond [very rare] ave was a few 10's of microseconds (i don't
have the data here right now).

>7. What are the effects of virtual memory?
Potentially big hits to timing, and determanism.  On the SGI we had 196MB
RAM so we
simply locked all all physical ram down and did not allow page swapping.

>8. How is memory organized and allocated?  Can memory be shared between
>   processes and tasks?
Yes, SPROCs share the memory space of their parents so if you create a
set of
unix processes they all share the address space of the program that
crated them.
Tasks on the sprocs the individual tasks share the same parent address
space.

You can also use shared memory to talk to unix processes create by
different parens
or forked.

>9. How are peripheral devices controlled and accessed from Ada tasks and
Unix
>   processes?
Sorry i didnt have to deal with this.



  parent reply	other threads:[~1994-09-27 13:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-09-26 18:12 Ada & UNIX Scott Catterill
1994-09-27 10:44 ` Tucker Taft
1994-09-27 13:49 ` James Hopper [this message]
  -- strict thread matches above, loose matches on Subject: below --
1994-09-28 18:41 Scott Catterill
1994-09-29 12:33 ` James Hopper
1994-09-29 13:49 ` Oliver E. Cole
replies disabled

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