Presentation is loading. Please wait.

Presentation is loading. Please wait.

Real Time Systems Event Deferral. Communication (part 2) - 2 Event Deferral – defined  real time systems are by default highly reactive  messages can.

Similar presentations


Presentation on theme: "Real Time Systems Event Deferral. Communication (part 2) - 2 Event Deferral – defined  real time systems are by default highly reactive  messages can."— Presentation transcript:

1 Real Time Systems Event Deferral

2 Communication (part 2) - 2 Event Deferral – defined  real time systems are by default highly reactive  messages can (and will) arrive at anytime  perhaps you don’t want or can’t deal with them at this time (you’re in the middle of a sequence)  not all messages necessarily need to be processed right away  design dependent  a mechanism is required for “deferring”, “recalling” and “purging” messages

3 Communication (part 2) - 3 Event Deferral – mechanics  Capsule.rtDeferMessage()  in the transition code of the receiving state machine  rtDeferMessage( );  //this will queue the message (FIFO) at the received port  ProtocolRole & InSignal recall(), purge()  in the transition code where it is determined that the message can now be handled  myPort.recall( [frontFlag] ); or myPort.mySignal( ).recall( );  this will recall the first deferred message on either the port or the type signal, and if frontFlag evaluates to TRUE, it will place it at the front of its message queue  returns true/false for recall()  returns the number of recalled messages for recallAll()

4 Communication (part 2) - 4 Event Deferral – mechanics (continued)  it must also be possible to “clean up” any deferred messages that may no longer be required / valid  myPort.purge( ); or myPort.mySignal( ).purge( );  //deletes messages or specific message from the queue  // returns the number of deleted messages from the defer queue.

5 Communication (part 2) - 5 Event Deferral – Example 1 - A Busy Robot If another pick-up request comes in: robotPort.pickup().recall(); rtDeferMessage( ); When delivery has been completed:

6 Communication (part 2) - 6 Example 2 - A Database Server

7 Communication (part 2) - 7 Example 2 - A Database Server TheSystem Structure Diagram Unwired, synchronous communication between multiple clients and the database system

8 Communication (part 2) - 8 Example 2 - A Database Server DatabaseSystem Structure Diagram Wired, asynchronous communication between QueryServer and the Database Note the relay port(s) for client requests

9 Communication (part 2) - 9 Example 2 - A Database Server QueryServer State Diagram 3. Upon completion of query send data to cache and recall all deferred messages: myPort.recallAll(); 2. Meanwhile, if another data request arrives, defer it - if so return data - if not defer message and query database 1. Upon receipt of first data request, check if data exists in cache


Download ppt "Real Time Systems Event Deferral. Communication (part 2) - 2 Event Deferral – defined  real time systems are by default highly reactive  messages can."

Similar presentations


Ads by Google