30.12.2013 Views

T-Kernel Specification (1.B0.02)

T-Kernel Specification (1.B0.02)

T-Kernel Specification (1.B0.02)

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.5. EXTENDED SYNCHRONIZATION AND COMMUNICATION FUNCTIONS 127<br />

4.5.3 Rendezvous Port<br />

Rendezvous is a function for synchronization and communication between tasks, supporting the procedures<br />

for making processing requests by one task to another and for returning the processing result to<br />

the requesting task. The object for which both of these tasks wait is called a rendezvous port. The<br />

rendezvous function is typically used to realize task communication in a client/server model, but can<br />

also support more flexible synchronization and communication models.<br />

Functions are provided for creating and deleting a rendezvous port, issuing a processing request to a<br />

rendezvous port (call rendezvous), accepting a processing request from a rendezvous port (accept rendezvous),<br />

returning the processing result (reply rendezvous), forwarding an accepted processing request<br />

to another rendezvous port (forward rendezvous to other port), and referencing rendezvous port status<br />

and rendezvous status. A rendezvous port is identified by an ID number called a rendezvous port ID.<br />

A task issuing a processing request to a rendezvous port (the client-side task) calls a rendezvous, designating<br />

a message (called a call message) with information about the rendezvous port, the rendezvous<br />

conditions, and the processing being requested. The task accepting a processing request on a rendezvous<br />

port (the server-side task) accepts the rendezvous, designating the rendezvous port and rendezvous conditions.<br />

The rendezvous conditions are indicated in a bit pattern. If the bitwise logical AND of the bit patterns<br />

on both sides (the rendezvous conditions bit pattern of the task calling a rendezvous for a rendezvous<br />

port and the rendezvous conditions bit pattern of the accepting task) is not 0, the rendezvous is established.<br />

The state of the task calling the rendezvous is WAIT on rendezvous call until the rendezvous is<br />

established. The state of the task accepting a rendezvous is WAIT on rendezvous acceptance until the<br />

rendezvous is established.<br />

When a rendezvous is established, a call message is passed from the task that called the rendezvous to<br />

the accepting task. The state of the task calling the rendezvous goes to WAIT for rendezvous completion<br />

until the requested processing is completed. The task accepting the rendezvous is released from WAIT<br />

state and it performs the requested processing. Upon completion of the requested processing, the task<br />

accepting the rendezvous passes the result of the processing in a reply message to the calling task and<br />

ends the rendezvous. At this point the WAIT state of the task that called the rendezvous is released.<br />

A rendezvous port has separate queues for tasks waiting on rendezvous call (call queue) and tasks waiting<br />

on rendezvous acceptance (accept queue). Note, however, that after a rendezvous is established, both<br />

tasks that formed the rendezvous are detached from the rendezvous port. In other words, a rendezvous<br />

port does not have a queue for tasks waiting for rendezvous completion. Nor does it keep information<br />

about the task performing the requested processing.<br />

T-<strong>Kernel</strong> assigns an object number to identify each rendezvous when more than one is established at the<br />

same time. The rendezvous object number is called the rendezvous number. The method of assigning<br />

rendezvous numbers is implementation-dependent, but at a minimum information must be included for<br />

designating the task that called the rendezvous. Numbers must also be uniquely assigned to the extent<br />

possible; for example, even if the same task makes multiple rendezvous calls, the first rendezvous and<br />

second rendezvous must have different rendezvous numbers assigned.<br />

[Additional Notes]<br />

Rendezvous is a synchronization and communication function introduced in the ADA programming<br />

language, based on Communicating Sequential Processes (CSP). In ADA, however, the rendezvous<br />

function is part of the language specification and therefore has a different role than in T-<strong>Kernel</strong>, which is<br />

a real-time kernel specification. The rendezvous ports provided by the real-time kernel are OS primitives<br />

by which an ADA rendezvous capability is implemented. Since the ADA rendezvous function differs<br />

from that in the T-<strong>Kernel</strong> specification in a number of ways, the T-<strong>Kernel</strong>-specification rendezvous<br />

functions cannot necessarily be used to implement the ADA rendezvous.<br />

Copyright c○ 2002, 2003 by T-Engine Forum<br />

T-<strong>Kernel</strong> <strong>1.B0.02</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!