
C#FBP V2.1
------------

J. Paul Morrison, Mar. 12, 2008

(See also http://www.jpaulmorrison.com/cgi-bin/wiki.pl?CsharpFBP)



A FRIENDLY PIECE OF ADVICE

First, a note of warning: it is not recommended that you try this software 
without reading the book first to get a basic understanding of the concepts and 
methodology.  This would be like being given a pile of girders and being told 
to build a bridge!  This is not because the concepts are complex - it is rather 
that they involve a paradigm change, and it is much easier to follow where someone 
else has been before, rather than having to rediscover them for yourself!

QUICK START GUIDE

I am assuming that you have some version of Microsoft Visual C# installed.

After you have downloaded the C#FBP zip file, there are 3 tests available to help you
make sure that everything is loaded correctly.  You can execute the one called MergeAndSort
by right-clicking on the _project_ called MergeAndSort (not the _TestNetwork_ called MergeAndSort), and selecting Debug/Start new instance.

You should see the following output (with some management stuff in front):

.....
The thread 0x8fc has exited with code 0 (0x0).
No. of elements:22
0089 abc
0090 abc
0091 abc
0091 abc
0092 abc
0092 abc
0093 abc
0093 abc
0094 abc
0094 abc
0095 abc
0095 abc
0096 abc
0096 abc
0097 abc
0097 abc
0098 abc
0098 abc
0099 abc
0099 abc
0100 abc
0100 abc
The thread 0x768 has exited with code 0 (0x0).
The thread 0x69c has exited with code 0 (0x0).
The thread 0xd3c has exited with code 0 (0x0).
The thread 0x8ac has exited with code 0 (0x0).
The thread 0xc48 has exited with code 0 (0x0).
The thread 0xde8 has exited with code 0 (0x0).
The program '[2240] MergeAndSort.vshost.exe: Managed' has exited with code 0 (0x0).
The program '[2216] StandAloneTest.vshost.exe: Managed' has exited with code 0 (0x0).  (*)

(* not sure why the previous line is present!)



If you've gotten to this point, your FBP installation is properly installed and functioning.



ADDITIONAL DEMOS

Additional demos can be found in FBPTest\TestNetworks; also Concord and StandAloneTest.



FOR MORE INFORMATION

More details and background are available at http://jpaulmorrison.com/fbp/.  

Please send suggestions, bug reports and constructive criticism to:
paul.morrison@rogers.com.



C#FBP New Features
------------------

    * We are adding a "long wait" state to components, specifying a timeout value in seconds. This is coded as follows: 

      double _timeout = 2;   // 2 secs

          ....

      LongWaitStart(_timeout);                                              
    //   activity taking time goes here
      LongWaitEnd();            

    * Typically, the timeout value is given a default value in the code, and overridden (if desired) by an IIP. 

    * While the component in question is executing the activity taking time, its state will be set to "long wait". If one or more components are in "long wait" state while all other components are suspended or not started, this situation is not treated as a deadlock. However, if one of the components exceeds its timeout value, an error will be reported (Complain). 

    * I have become persuaded by a colleague that a components' responsibility for an IP is discharged once it issues a Send. This suggests that Send should not return a "success/fail" indicator, but should simply crash the program (FlowError.Complain) if a data packet cannot be delivered - either because the receiving input port is closed, or no connection was specified. This means that the network designer should connect any output ports sending unneeded data to a Discard or Log component. 

    * David Bennett has suggested a simpler "connect" notation: 

    Connect("componentA.portname", "componentB.portname");

    * This assumes that the component names have been associated with a type in an earlier statement of the form 

    Component("xxxxx", typeof(yyyyy));

    * If one of the ports involved is an array port, the port array name and index can be entered as 

    portname[index]

    * where "index" is an absolute number 

    * Input and output port names will be coded on components using attribute notation. This is metadata that can be used to do analysis of networks without having to actually execute the components involved. Here is an example of the attributes for the "Collate" component: 

    [InPort("CONFIG")]
    [InPort("IN", arrayPort = true)]
    [OutPort("OUT")]  

    public class Collate : Component

    * Input ports do not necessarily have to be connected, even though attributes are specified for them; output ports, however, must be. 

    * Attribute notation is also used to specify the MustRun attribute, as follows:

     [MustRun]	 

    * The input ports to which IIPs are connected should be closed by the component code after the receive has been done - this ensures that, if fed by an upstream component rather than an IIP, only one IP can be sent successfully. Once the port is closed, an additional send will cause the sending component to abort. 

    * Unlike the 1.5.3 and earlier versions of JavaFBP, an IIP will only be received once per invocation - additional receives just return null. This change will also be implemented in the next release of JavaFBP. 

    * ... and of course the services all start with upper case letters... 

                  ************************************************************** 
                  *                                                            * 
                  * Note: a subnet capability has not been provided yet - this *
                  *        will be provided in the next release.               *
                  *                                                            *
                  **************************************************************  
