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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5df725f58ba75d6e X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!wn13feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: Distributed programming Reply-To: anon@anon.org (anon) References: X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Sat, 05 Jul 2008 03:22:09 GMT NNTP-Posting-Host: 12.64.90.89 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1215228129 12.64.90.89 (Sat, 05 Jul 2008 03:22:09 GMT) NNTP-Posting-Date: Sat, 05 Jul 2008 03:22:09 GMT Organization: AT&T Worldnet Xref: g2news1.google.com comp.lang.ada:1011 Date: 2008-07-05T03:22:09+00:00 List-Id: In GNAT Ada package. the Remote_Call_Interface work but the and System.RPC (remote procedure calls) are basically dummy routines, see System.RPC ("s-rpc.adb"). The System.RPC active routines are in the GLADE and other packages. GLADE for one has some examples that you might be able to adapt to use needs. Note: GLADE can be use for Ada-95, but Adacore decided to replace GLADE with the PolyORB package (by PolyORB) for "Ada 2005" and later. Note: Most people just use networking instead, since it common to most OS and is widely used in all languages. You can find simple networking examples in Ada, C, COBOL, FORTRAN, Java, Pascal, etc on the net. Plus: A set of Tasking partitions with conditional "Accept" statement can simulate the System.RPC and Remote_Call_Interface. This way you can still use the protocols of Annex E without getting into the limitation (rules of Annex E) using the routines in the System.RPC. Once you learn the basics then you can try adding the features of the Annex E. As for Annex E being buggy. It is difficult, initially to use but it does work quite efficient when used. As for an example that meet the RM Annex E (from GLADE package). ------------------------------ -- pure.ads -- package Pure is pragma Pure; N_Counts : constant := 10; N_Robots : constant := 10; type Message_Type is record Value : Integer; Count : Integer := 0; end record; end Pure; ------------------------------ -- rci.ads -- package RCI is pragma Remote_Call_Interface; procedure Start (P : Natural); end RCI; ------------------------------ -- rci.ads -- with Ada.Text_IO; use Ada.Text_IO; with System.RPC; use System.RPC; with System.RPC.Stream_IO; use System.RPC.Stream_IO; with Pure; use Pure; package body RCI is task type Robot_Type is entry Start (I : Natural); end Robot_Type; task body Robot_Type is M : Message_Type; P : Natural; S : aliased Partition_Stream_Type; begin accept Start (I : Natural) do P := I; end Start; Ada.Text_IO.Put_Line ("Listen to" & P'Img); while M.Count < N_Counts loop Open (S, Any_Partition, In_Mode); Message_Type'Read (S'Access, M); Ada.Text_IO.Put_Line ("Received message" & M.Value'Img & " with count" & M.Count'Img); Close (S); M.Count := M.Count + 1; Open (S, Partition_ID (P), Out_Mode); Message_Type'Write (S'Access, M); Close (S); end loop; end Robot_Type; Robots : array (1 .. N_Robots) of Robot_Type; procedure Start (P : Natural) is begin for N in Robots'Range loop Robots (N).Start (P); end loop; end Start; end RCI; ------------------------------ -- Main.adb -- with RCI; use RCI; with System.RPC; use System.RPC; with System.RPC.Stream_IO; use System.RPC.Stream_IO; with Ada.Streams; use Ada.Streams; with Ada.Text_IO; use Ada.Text_IO; with Pure; use Pure; procedure Main is task type Robot_Type is entry Start (I : Integer); end Robot_Type; task body Robot_Type is M : Message_Type; S : aliased Partition_Stream_Type; begin accept Start (I : Integer) do Put_Line ("Start robot" & I'Img); M.Value := I; end Start; while M.Count < N_Counts loop Open (S, RCI'Partition_ID, Out_Mode); Message_Type'Write (S'Access, M); Put_Line ("Send message" & M.Value'Img & " with count" & M.Count'Img); Close (S); Open (S, RCI'Partition_ID, In_Mode); Message_Type'Read (S'Access, M); Close (S); end loop; end Robot_Type; Robots : array (1 .. N_Robots) of Robot_Type; begin RCI.Start (Main'Partition_ID); for N in Robots'Range loop Robots (N).Start (N); end loop; end Main; In , =?ISO-8859-1?Q?S=E9bastien_Morand?= writes: >-----BEGIN PGP SIGNED MESSAGE----- >Hash: SHA1 > >Hi, > >I'm trying to get working the annex E of Ada about Distributed >programming. I get very few pieces of information about it. > >Is there any body out there able to give me some tips how to use >disttribuated programming? > >I know there is some pragma: Remove_Call_Interface for example, but I >don't know how to get them working. > >Thanks by advance, > >Sebastien >-----BEGIN PGP SIGNATURE----- >Version: GnuPG v1.4.5 (Cygwin) > >iD8DBQFIbPcr+zV9xm4PlDQRAlV5AJ9pzIWO6+xda2voqWrgpx2Ce4QapwCdGbnr >oavwffeM8rb0I1GeeLpkZ/0= >=LmgZ >-----END PGP SIGNATURE-----