tcl.phantom Introductory/SQL

tcl.phantom

Command tcl.phantom Introductory/SQL
Applicable release versions: AP
Category SQL (13)
Description background process which runs without a terminal.

Pick has a phantom process scheduler which is itself a background process.

The scheduler process sleeps until a running job completes or until a new job enters the queue.

Phantom jobs are spawned using the "z" verb from TCL. (See the "z" command).

A phantom job runs if there is an available phantom port. If there is no phantom port available, the phantom job is enqueued until one becomes available.

When a phantom job completes, it wakes the scheduler and logs itself off. The process is now available for other phantom tasks.

When a phantom job is executed, four things happen:

1 A pcb frame is fetched from overflow for the phantom job.
2 An item is written to the "dm,jobs," file which indicates that the request is waiting in the queue.
3 The item-id of the jobs file item is attached to the end of the queue.
4 The scheduler process is awakened if it is asleep.

When the scheduler wakes up, it checks the queue and reads the item from the jobs file that corresponds to the next item-id in the queue.

If a port is available, the scheduler does three things:

1 The scheduler updates the status of the item in the jobs file to 'running'.
2 It then adds an item to the jobs file using the "port.number" as the item-id.
3 Finally, the phantom job is logged on to the port.

When a phantom process has finished, the status in the jobs file is updated to 'logged off'. Next, the phantom is awakened and workspace is returned to overflow.

When the scheduler releases a phantom job back to overflow, the item whose "port.number" is the item-id of the job, is deleted from the jobs file.

The Spooler is a phantom job in AP.

See the "end" command for terminating phantom jobs.

The "p" option in the "users" file terminates phantom processes when a gfe is encountered, rather than just going to sleep. See "users".

To increase the number of phantom pibs on a Unix-based implementation of AP, edit the "pick0" file and decrease the value of "npibs" by the same number as that added to the value of "nphts". For example, if "npibs" is 10 and "nphts" is 12, change "npibs" to 8 and "nphts" to 14 to add 2 more phantoms.
Syntax
Options
Example
Purpose
Related port.number
tcl.z
phantom.process.scheduler
phantom.ports
tcl.phantom-status
tcl.logon
tcl.jobs.status
tcl.tcl
background.process
tcl.start.ss
tcl.end
tcl.list-jobs
filename.jobs
filename.users
tcl.startsched
tcl.stopsched
tcl.phantom-status
ue.0010
tcl.phantom-reset