locate_task
locate_task — finds and connects to tasks by name.
locate_task (task_name, async_reqd)
task_nameThe name of the task to locate. The other task must have
declared this name through init_ipc or name_attach.
async_reqdt if
locate_task should automatically call
init_async_ipc for this
task.
A task if successful, otherwise nil.
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
|
![]() | |
The two tasks are initiated with |
Task 1:
Gamma>init_ipc("first","Q1");tGamma>getpid();9231Gamma>tsk = locate_task("second",nil);#<Task:9092>Gamma>send (tsk, #princ("Are you there?\n"));tGamma>
Task 2:
Gamma>init_ipc("second","Q2");tGamma>getpid();9092Gamma>next_eventAre you there? tGamma>