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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4f1f6efa7df4b008 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-09-27 06:50:37 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!swrinde!ihnp4.ucsd.edu!mvb.saic.com!dayuc.dayton.saic.com!hopper.dayton.saic.com!hopperj From: James Hopper Newsgroups: comp.lang.ada Subject: Re: Ada & UNIX Date: 27 Sep 1994 13:49:29 GMT Organization: SAIC Distribution: world Message-ID: <3697ta$isq@dayuc.dayton.saic.com> References: NNTP-Posting-Host: hopper.dayton.saic.com X-Newsreader: Nuntius Version 1.3b11 X-XXMessage-ID: X-XXDate: Tue, 27 Sep 1994 09:52:50 GMT Date: 1994-09-27T13:49:29+00:00 List-Id: >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.