RE: SDL-News: Communication between processes in different blocks


Subject: RE: SDL-News: Communication between processes in different blocks
From: gopalvr (gopalvr#future.futsoft.com)
Date: Tue Aug 11 1998 - 17:43:00 GMT


The originator of this message is responsible for its content.
-----From gopalvr <gopalvr#future.futsoft.com> to sdlnews -----

Dear Sergio Lopes,
Some Code Generators generate the addresses for the process instances in
a deterministic way. For example in CMicro of SDT, the PID is implemented
as an integer, where the lower order byte represents the Process type
(determined at the compile time) and the higher orde byte indicates the
instance number of that process. This means that even without having a
manager process the PID of the destination process instance can be
calculated and this can be used in the TO Pid construct. For example if
you want to send a signal to the 3rd instance of process A then you have
to get the process type value and calculate the PID value using the
process type value and the instance. This method will be more efficient
than using a manager process, but may not be an elegant soluton as it
depends on the internals of the code generator.

Regards
Rajagopal
==========================================================================
===
V.Rajagopal
Future Software Pvt Ltd
Chennai
India
91-44-4330550 ext 313 email: gopalvr#future.futsoft.com
==========================================================================
======
 -----Original Message-----
From: sdlnews-owner [SMTP:sdlnews-owner#sdl-forum.org]
Sent: Tuesday, August 04, 1998 8:25 PM
To: sdlnews
Subject: SDL-news: Communication between processes in different blocks

The originator of this message is responsible for its content.
 -----From Sergio Lopes <Sergio.Lopes#dei.uminho.pt> to sdlnews -----

Dear SDLers,

I have the following problem:

I two processes in different blocks with 2 instances of each in the
block. I want to establish communication between them in a deterministic
way, this is, I want the instance 1 in the 1st block to communicate with
the instance 1 of the 2nd block. As I cannot create a child process in
different block, how do I solve this? I looking for the most efficient
manner to do it.
To better clarify the problem I've included the PR description of an
example matching the problem:

SYSTEM examplesystem;

  newtype ExampleType
   struct
   field1 natural;
   field2 integer;
  endnewtype;
    

  signal
  mesg1(ExampleType), mesg2;

  CHANNEL ch
    FROM block1 TO block2 WITH mesg1;
    FROM block2 TO block1 WITH mesg2;
  ENDCHANNEL;

  BLOCK block1;

    SIGNALROUTE r1
      FROM process1 TO ENV WITH mesg1;
      FROM ENV TO process1 WITH mesg2;

    CONNECT ch AND r1;

    PROCESS process1
    (2,2);
      dcl a ExampleType;
      START ;
        NEXTSTATE state1;
      STATE state1;
        INPUT mesg2;
          TASK 'do something';
          OUTPUT mesg1(a);
          NEXTSTATE -;
      ENDSTATE;
    ENDPROCESS;

  ENDBLOCK;

  BLOCK block2;

    SIGNALROUTE r2
      FROM ENV TO process2 WITH mesg1;
      FROM process2 TO ENV WITH mesg2;

    CONNECT ch AND r2;

    PROCESS process2
    (2,2);

      dcl a ExampleType;
      dcl b natural, c, d integer;

      START ;
        NEXTSTATE state1;
      STATE state1;
        INPUT mesg1(a);
          DECISION a;
            ( (. b, c .) ):
              TASK 'do something';
            ( (. b, d .) ):
              OUTPUT mesg2;
            ELSE:
          ENDDECISION;
          NEXTSTATE -;
      ENDSTATE;
    ENDPROCESS;

  ENDBLOCK;

ENDSYSTEM;

By the way, I have another problem still: how can avoid the GROUND
EXPRESSION EXPECTED warning in the decision of process2?
That is, Is it possible to have decision answers with variables?

Thank you in advance.

Best regards,
Sergio Lopes.

=====================================================
Name: Sergio Adriano Fernandes Lopes
Address: Dpto Electronica Industrial e-mail:
sfl#dei.uminho.pt
        Universidade do Minho Tel.: +351 53 510190
        Campus de Azurem Fax: +351 53
510189
        4800 Guimaraes
        PORTUGAL
                        

=====================================================

 -----End text from Sergio Lopes <Sergio.Lopes#dei.uminho.pt> to sdlnews
 -----
For help, email "majordomo#sdl-forum.org" with the body of your email as:
    help
or (iff this does not answer your question) email:
owner-sdlnews#sdl-forum.org

-----End text from gopalvr <gopalvr#future.futsoft.com> to sdlnews -----
For help, email "majordomo#sdl-forum.org" with the body of your email as:
    help
or (iff this does not answer your question) email: owner-sdlnews#sdl-forum.org



This archive was generated by hypermail 2a23 : Sun Jun 16 2013 - 10:41:40 GMT