<?xml version="1.0" standalone="yes"?>
<csim_hw_file>
CGUIformatVersion 1.890000




%include $CSIM_MODEL_LIBS/user_contributed/named_synchron.sim





DEFINE_DEVICE_TYPE:  Server1

  DEFINE_THREAD:   start_up
   {
    SYNCHRON **x;

    x = Get_Named_Synchron( "S1" ); 
    while (1)
     {    
      WAIT( x, QUEUABLE );
      csim_printf("Server Contacted.\n\n");
     }
   }
  END_DEFINE_THREAD.

END_DEFINE_DEVICE_TYPE.





DEFINE_DEVICE_TYPE:  Client1

  DEFINE_THREAD:   start_up
   {
    SYNCHRON **x;
    int k;

    x = Get_Named_Synchron( "S1" ); 
    for (k=0; k<5; k++)
     {
      DELAY( 100.0 );
      csim_printf("Client contacting Server.\n");
      RESUME( x, QUEUABLE );
     }
   }
  END_DEFINE_THREAD.

END_DEFINE_DEVICE_TYPE.




<DEFINE_MODULE>  top_level <top_diagram> </top_diagram>
  <DEFINE_NODE_INSTANCES>
	<ins 1> BoxA  =  Server1	
	  <vrt> 1.2 2.8  4 4.8 </vrt> </ins>
	<ins 1> BoxB  =  Client1	  	
	  <vrt> 6 2.8  8.8 4.8 </vrt> </ins>
  </DEFINE_NODE_INSTANCES>
  <DEFINE_TOPOLOGY>
  </DEFINE_TOPOLOGY>
</DEFINE_MODULE>


</csim_hw_file>
