comp.lang.ada
 help / color / mirror / Atom feed
* Distributed programming
@ 2008-07-03 15:58 Sébastien Morand
  2008-07-04  9:09 ` Ken Thomas
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Sébastien Morand @ 2008-07-03 15:58 UTC (permalink / raw)


-----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-----



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Distributed programming
  2008-07-03 15:58 Distributed programming Sébastien Morand
@ 2008-07-04  9:09 ` Ken Thomas
  2008-07-04  9:20   ` Ken Thomas
  2008-07-04  9:40 ` xavier grave
  2008-07-05  3:22 ` anon
  2 siblings, 1 reply; 6+ messages in thread
From: Ken Thomas @ 2008-07-04  9:09 UTC (permalink / raw)


On Jul 3, 4:58 pm, Sébastien Morand <seb.mor...@gmail.com> wrote:
> -----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-----

A good strategy would be to get the examples from GLADE working. For
reading material,  good sources are the books

Burns, A. and A. J. Wellings (1995). Concurrency in ADA. Cambridge ;
New York, Cambridge University Press.

Burns, A. and A. J. Wellings (2007). Concurrent and real-time
programming in Ada 2005. Cambridge ; New York, Cambridge University
Press.

Ken







^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Distributed programming
  2008-07-04  9:09 ` Ken Thomas
@ 2008-07-04  9:20   ` Ken Thomas
  2008-07-04  9:44     ` Sébastien Morand
  0 siblings, 1 reply; 6+ messages in thread
From: Ken Thomas @ 2008-07-04  9:20 UTC (permalink / raw)


On Jul 4, 10:09 am, Ken Thomas <k...@ecs.soton.ac.uk> wrote:
> On Jul 3, 4:58 pm, Sébastien Morand <seb.mor...@gmail.com> wrote:
>
>
>
>
>
> > -----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-----
>
> A good strategy would be to get the examples from GLADE working. For
> reading material,  good sources are the books
>
> Burns, A. and A. J. Wellings (1995). Concurrency in ADA. Cambridge ;
> New York, Cambridge University Press.
>
> Burns, A. and A. J. Wellings (2007). Concurrent and real-time
> programming in Ada 2005. Cambridge ; New York, Cambridge University
> Press.
>
> Ken- Hide quoted text -
>
> - Show quoted text -

Have just checked: Burns & Wellings (2007) does not cover Annex E. Mea
culpa.
Ken



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Distributed programming
  2008-07-03 15:58 Distributed programming Sébastien Morand
  2008-07-04  9:09 ` Ken Thomas
@ 2008-07-04  9:40 ` xavier grave
  2008-07-05  3:22 ` anon
  2 siblings, 0 replies; 6+ messages in thread
From: xavier grave @ 2008-07-04  9:40 UTC (permalink / raw)
  To: Sébastien Morand

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

S�bastien Morand a �crit :
> 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

Hi,

For a good start you should use GNAT GPL 2007 + GLADE 2007
(to download from http://libre.adacore.com)

There is examples in the GLADE tarball.

Annex E in GNAT GPL 2008 is supported with PolyORB. But, as far as I
understand, the support for Annex E is bugged. I had several problem
with it, I have started to try to debug it in order to use PolyORB in
the future instead of GLADE, since GLADE isn't supported any more by ACT.

Cordially, xavier
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkht8AEACgkQVIZi0A5BZF4XWACgnkVFJlO3D/MXQ0fI/uiw9PIl
X0UAnR326Hg4KEC7xZCYLtgURrUccZlC
=eFgS
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Distributed programming
  2008-07-04  9:20   ` Ken Thomas
@ 2008-07-04  9:44     ` Sébastien Morand
  0 siblings, 0 replies; 6+ messages in thread
From: Sébastien Morand @ 2008-07-04  9:44 UTC (permalink / raw)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>> A good strategy would be to get the examples from GLADE working. For
>> reading material,  good sources are the books
>>
>> Burns, A. and A. J. Wellings (1995). Concurrency in ADA. Cambridge ;
>> New York, Cambridge University Press.
>>
>> Burns, A. and A. J. Wellings (2007). Concurrent and real-time
>> programming in Ada 2005. Cambridge ; New York, Cambridge University
>> Press.
>>
>> Ken- Hide quoted text -
>>
>> - Show quoted text -

> Have just checked: Burns & Wellings (2007) does not cover Annex E. Mea
> culpa.
> Ken

Thanks for your answer. Maybe it means that I shouldn't try this way,
should I?

The important point is Distributed programming with or wothout annex E.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iD8DBQFIbfDo+zV9xm4PlDQRAqbdAJ9S4JoCWb/AUxiNz1aBXsb7qTdB9ACfb96E
vQT3BuR6USRvY7Mq/FE0Nlw=
=PkQt
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Distributed programming
  2008-07-03 15:58 Distributed programming Sébastien Morand
  2008-07-04  9:09 ` Ken Thomas
  2008-07-04  9:40 ` xavier grave
@ 2008-07-05  3:22 ` anon
  2 siblings, 0 replies; 6+ messages in thread
From: anon @ 2008-07-05  3:22 UTC (permalink / raw)


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 <g4isvd$mf6$1@registered.motzarella.org>, =?ISO-8859-1?Q?S=E9bastien_Morand?= <seb.morand@gmail.com> 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-----




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-07-05  3:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-03 15:58 Distributed programming Sébastien Morand
2008-07-04  9:09 ` Ken Thomas
2008-07-04  9:20   ` Ken Thomas
2008-07-04  9:44     ` Sébastien Morand
2008-07-04  9:40 ` xavier grave
2008-07-05  3:22 ` anon

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