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


Subject: Re: SDL-News: Communication between processes in different blocks
From: Aldo Buratti (buraldo#maganet.net)
Date: Wed Aug 19 1998 - 00:15:41 GMT


Dear SDLers

I'm thinking over the problem raised by Sergio Lopez :

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

It seems perfectly clean, but what about the solutions?Let me try to resume ...

Solution A. (Yoni Rabinovitch)

> Regarding this problem (as well as the related "broadcast" problem being
> discussed) - are you looking for a "pure" SDL solution, or for something which
> can be used in a real application (though not pure SDL). If the latter is
> sufficient, then the SDL tools (or at least, SDT), provide workarounds (in the
> form of non-pure-SDL ADTs) which can be used from within the SDL system.

It is so simple, but it seems to me contrary to the spirit of a standardization
organization.

Solution B. (Philippe Leblanc)

> To solve the non-determinism in your example, the signal outputs must be made
> with a TO Pid construct. For this purpose, a Manager process could be included
> in each block to instantiate the local processes and exchange their addresses
> with the remote block.

This one can be a good and general solution but, as claimed by David Pedlar:

> Too much of the model seemed to be there just to keep the objects informed of
> the PIDs of other objects

So, now it's time for my proposal

Solution C. (Aldo Buratti)

Let me declare the problem again:
"Given two kind of Processes A and B, each one instantiated N times, sketch a
pattern in order to establish a connection between instance j of process A and
instance j of process B"

The following picture is an overview of the pattern:
[Image]
Here, some words for an explanation:

Step One:
First of all, we have to break and re-compose the Block-structure in order to
isolate the Processes A and B, and then put them in a new Block-Type.
Since A and B are single instances, there's no need to specify a PID (the address
of the receiver) when OUTPUTting a signal; just specify the output gate.
Step Two:
Now, i order to create N pairs of A and B, simply declare an instance of the Block
Type "A_Bpair" , repeated N times.

That's all !
As you can see:
PROS: No need of extra process/procedures acting as PID-manager
PROS: No proprietary extension (Just SDL-92)
CONS: A and B should be static; they cannot be created at runtime (as long as SDL
doe not allow the dynamic Block-Creation [maybe SDL-2000 or SDL-00 :-) ]
CONS: you have to review the Block structure (the "architecture"), so tat A and B
be in the same block-type.
CONS: .. many details about the Blocks/Processes surrounding the A_B block
instance are missing ... [ and perhaps you are forced to introduce again a
PID-manager ....

Resuming in few words:
Don't try to pair off N copies of A and N copies of B;
try to create N copies of A-B pairs

P.S. You can find attached the SDL-program of the above discussed solution.

 Best Regards
    Aldo Buratti

Dear SDLers

I'm thinking over the problem raised by Sergio Lopez :
 

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.
It seems perfectly clean, but what about the solutions?Let me try to resume ...

Solution A. (Yoni Rabinovitch)

Regarding this problem (as well as the related "broadcast" problem being discussed) - are you looking for a "pure" SDL solution, or for something which can be used in a real application (though not pure SDL). If the latter is sufficient, then the SDL tools (or at least, SDT), provide workarounds (in the form of non-pure-SDL ADTs) which can be used from within the SDL system.
It is so simple, but it seems to me contrary to the spirit of a standardization organization.

Solution B. (Philippe Leblanc)

To solve the non-determinism in your example, the signal outputs must be made with a TO Pid construct. For this purpose, a Manager process could be included in each block to instantiate the local processes and exchange their addresses with the remote block.
This one can be a good and general solution but, as claimed by David Pedlar:
Too much of the model seemed to be there just to keep the objects informed of the PIDs of other objects
 

So, now it's time for my proposal

Solution C. (Aldo Buratti)

Let me declare the problem again:
"Given two kind of Processes A and B, each one instantiated N times, sketch a pattern in order to establish a connection between instance j of process A and instance j of process B"

The following picture is an overview of the pattern:

Here, some words for an explanation:

Step One:
First of all, we have to break and re-compose the Block-structure in order to isolate the Processes A and B, and then put them in a new Block-Type.
Since A and B are single instances, there's no need to specify a PID (the address of the receiver) when OUTPUTting a signal; just specify the output gate.
Step Two:
Now, i order to create N pairs of A and B, simply declare an instance of the Block Type "A_Bpair" , repeated N times.

That's all !
As you can see:
PROS: No need of extra process/procedures acting as PID-manager
PROS: No proprietary extension (Just  SDL-92)
CONS: A and B should be static; they cannot be created at runtime (as long as SDL doe not allow the dynamic Block-Creation [maybe SDL-2000 or SDL-00 :-) ]
CONS: you have to review the Block structure (the "architecture"), so tat A and B be in the same block-type.
CONS: .. many details about the Blocks/Processes surrounding the A_B block instance are missing ... [ and perhaps you are forced to introduce again a PID-manager ....

Resuming in few words:
Don't try to pair off N copies of A and N copies of B;
try to create N copies of A-B pairs

P.S. You can find attached the SDL-program of the above discussed solution.
 
 

 Best Regards
    Aldo Buratti




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