locate_task (task_name, async_reqd)
The name of the task to locate. The other task must have declared this name through init_ipc or name_attach.
t if locate_task should automatically call init_async_ipc for this task.
This function makes a call to the name locator task for the current operating system. If it finds the named task it makes an IPC connection (in TCP/IP) or creates a virtual circuit (in QNX 4) to that task. If async_reqd is t, then init_async_ipc is also called.
When Gamma locates a task, it returns a printed representation of it, which looks like this: #<Task:10120>. This representation cannot be read back into Gamma, so a symbol is usually assigned when calling locate_task to facilitate refering to or working with a task. We refer to this symbol as the task descriptor. For instance, in the example below, the symbol tsk is the task descriptor. |
The two tasks are initiated with init_ipc before calling locate_task. |
Task 1:
Gamma> init_ipc("first","Q1"); t Gamma> getpid(); 9231 Gamma> tsk = locate_task("second",nil); #<Task:9092> Gamma> send (tsk, #princ("Are you there?\n")); t Gamma>
Task 2:
Gamma> init_ipc("second","Q2"); t Gamma> getpid(); 9092 Gamma> next_event Are you there? t Gamma>
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.