TOC PREV NEXT INDEX DOC LIST MASTER INDEX



Fast Rendezvous Optimization

Normally the accept body of an Ada rendezvous is executed only in the context of the acceptor task. The fast rendezvous optimization executes the accept body in the context of the caller task. This optimization reduces the number of thread context switches that need to be executed by the underlying microkernel.

Note: The Fast Rendezvous optimization is not supported by the ts3 version of the runtime archive library.

Following is an overview of the optimization: if the acceptor task gets to the accept statement before the caller task makes the call, the acceptor task saves its register and stack context, switches to a wait stack, and does an Ada_Krn_I.Task_Wait. When the caller task gets around to doing the accept call, it saves its register and stack context, restores the acceptor task's register and stack context and returns to execute the accept body. When the end of the accept body is reached, the caller task overwrites the current register and stack context into the acceptor task's area, does an Ada_Krn_I.Task_Signal of the acceptor task, restores the caller task's register and stack context, and returns to the code in the caller task. Eventually, when the signaled acceptor task is scheduled to run, it restores the acceptor task's register and stack context (this context was updated by the caller task to be at the point where the call was made to finish the accept body) and returns to the code in the acceptor task after the call was made to finish the accept body.

Two configuration parameters are in v_usr_conf to control the fast rendezvous optimization:

Fast_Rendezvous
Setting this parameter to True enables the fast rendezvous optimization. This parameter would need to be set to False only for multiprocessor Ada, where the accept body must execute in the acceptor task bound to a processor. It defaults to True
Wait_Stack_Size
This parameter specifies how much stack is needed when the acceptor task switches from its normal task stack to a special stack it can use to call Ada_Krn_I.Task_Wait.

When using the debugger, the fast rendezvous optimization (accept body is executed by the caller task) has a few subtle differences from the normal rendezvous case (accept body is executed by the acceptor task).

Following is an example to illustrate the differences. There are two tasks doing a repetitive rendezvous. The caller task is Rendezvous_Send. The acceptor task is Rendezvous_Receive. A breakpoint has been placed in the acceptor body. There are two cases: either the breakpoint is reached when the acceptor task (Rendezvous_Recieve) is executing the accept body or the caller task (Rendezvous_Send) is executing the acceptor body. Here is the debugger output for the two cases.

Case 1: At breakpoint when the acceptor task is executing the accept body (normal rendezvous)
Case 2: At breakpoint when the caller task is executing accept body (fast rendezvous)

Here are the subtle differences for the fast rendezvous, case 2:

For more information on the hierarchy of runtime archives see Library Selection.


Rational Software Corporation 
http://www.rational.com
support@rational.com
techpubs@rational.com
Copyright © 1993-2002, Rational Software Corporation. All rights reserved.
TOC PREV NEXT INDEX DOC LIST MASTER INDEX TECHNOTES APEX TIPS