Child Task Management
The PL/B Web Server child task management allows a PL/B client browser to reconnect from a hibernation
or sleep state to resume execution of the PLB program.
Definitions:
-
child task
-
A child process or thread that is created at the PL/B Web Server to execute a PLB program and communicate
with a browser UI client. A child task can exist in one of three states defined as 'active', 'idle',
or 'suspended'.
-
pending license count
-
When child process that is set to an 'idle' or 'suspended' child task state with a license count, the
license count is identified as a pending license count. The pending license count continues to be controlled
by the child task until the child task is terminated or until there are no more available license counts
as authorized for the PWS server. If a pending license count exists for a child task and a new PWS logon
request is received, the pending license count is removed and transferred to the new log on child task.
The 'idle' or 'suspended' child task can only resume execution after it acquires a new license count.
-
active child task
-
A current child task that is executing a PLB program which is actively connected and interfacing with
a client browser. An active child task uses a PWS licensed logon user count.
-
idle child task
-
A current child task that has remained in the same ALERT, ERROR dialog, KEYIN, MENU, or EVENTWAIT for
an extended amount of elapsed time defined by the keyword named PLBWEB_IDLE_TIMEOUT or the default time
of 15 minutes when the keyword is not used. A child task in the 'idle' state has a PWS pending license
count that it controls. The 'idle' child task is connected and interfacing with a client browser. However,
while the child task is set to the 'idle' state, the pending license count can be transferred to a new
child task if no PWS authorized license counts are available. The the 'idle' child task does not have
a current pending license count, it can only resume program execution by acquiring a new license count.
-
suspended child task
-
An 'active' or 'idle' child task that is not communicating with a client browser because the device\system
where the browser is executing has gone into a sleep or hibernation state which prevents the PLB JavaScript
from communicating with the PWS server. A child task that is in the 'suspended' state continues to maintain
a pending license count until the PWS authorized license counts are exhausted and a new child task logon
request has been received. In this case, the 'suspended' child task pending license count is removed
and transferred to the new child task.
Keywords:
-
PLBWEB_MAX_TASKS={maxtasks}
-
By default, the PL/B Web Server supports up to 2000 concurrent child tasks that exist in an 'active',
'idle', or 'suspended' state. This keyword can be used in the 'plbwebsrv.ini' file to configure the current
maximum childs tasks allowed. If this keyword is used, the {maxtasks} value cannot be less than the number
of authorized licensed users being used for the PWS server.
Note:
1. One
reason for using this keyword is to restrict the total number of child tasks because the system executing
the PWS server has limited OS resources.
2. Changes
to this keyword ONLY take affect when the PWS server is restarted to allocate and initialize global OS
resources.
-
PLBWEB_IDLE_TIMEOUT={minutes}
-
By default, the PL/B Web Server places a PWS child task in the 'idle' state after 15 minutes when this
keyword is not used. Otherwise, this keyword can be used to set the appropriate number of minutes before
a child task is placed in an idle state.
Note:
1.
If the elapsed time for the idle timeout expires while a child task remains in the same ALERT, ERROR dialog,
KEYIN, MENU, or EVENTWAIT instruction, the child task is placed in an 'idle' state. Likewise, a child
task is placed in an 'idle' state if the program execution remains in the PWS runtime MODAL internal event
process when the idle timeout expires.
2. A
child task in the 'idle' state may or may not have control of a PWS pending licensed user count.
3. Changes
to this keyword take affect when a new user logon occurs which creates a new child task.
-
PLBWEB_IDLE_MAX_TIMEOUT={minutes}
-
By default, the PL/B Web Server terminates any child task that remains in the 'idle' state for an elapsed
time longer than 1440 minutes (i.e. 1 day) when this keyword is not used. Otherwise, this keyword can
be used to set the appropriate number of minutes that a child task can remain in an 'idle' state before
being terminated. The minimum allowed value for the {minutes} is 5 minutes.
Note:
1. A
child task in the 'idle' state may or may not have control of a PWS pending licensed user count.
2. When
the child task is terminated the PWS licensed user count is freed and available for any client logon requests.
3. If
a new child task logon request is received, a pending licensed user count can be removed from the 'idle'
child task and given to the new child task. If an 'idle' child task does not have a pending license count,
it can only resume executing after it acquires a new license count. If a new license count cannot be
acquired, the 'idle' child task is terminated with an appropriate client browser error message.
4. Changes
to this keyword take affect when a new user logon occurs which creates a new child task.
-
PLBWEB_MSG_TIMEOUT={seconds}
-
By default, the PL/B Web Server places a child task in the 'suspended' state if an elapsed time of 10
seconds expires without any communication being received from the client browser JavaScript when this
keyword is not used. Otherwise, this keyword can be used to set the number of seconds that the PWS server
waits for a communication from the client browser before suspending a child task. The minimum number of
allowed {seconds} is 10.
Note:
1. If
the device or system where a client browser is executing goes into a sleep or hibernation state which
prevents communications with the PWS server, the child task is placed in a 'suspended' state after a default
of 10 seconds or the number of seconds specified by the PLBWEB_MSG_TIMEOUT keyword expires.
2. A
child task in the 'suspended' state may or may not use a PWS pending licensed user count. However, the
license user count of a 'suspended' child task is revoked and transferred to any child logon request the
requires an 'active' license.
3. Any
child task in the 'active' or 'idle' states can be placed in a 'suspended' state.
4. Changes
to this keyword take affect when a new user logon occurs which creates a new child task.
5. If
the device or system executing the client browser resumes from a sleep or hibernation state, the PLB JavaScript
can re-establish a connection with an existing child task in a 'suspended' state only if it still controls
a PWS pending user license or if it can acquired a new PWS license count.
-
PLBWEB_SUSPEND_MAX_TIMEOUT={minutes}
-
There is a maximum time that a child task can continually exist in the 'suspended' state before it is
terminated. By default, the PL/B Web Server allows a child task to remain in the 'suspended' state for
up to 60 minutes before the child task is terminated. This keyword can be used to set the maximum allowed
{minutes} that a child task can remain in the 'suspended' state before being terminated.
Note:
1. A
child task can ONLY exist in a 'suspended' state for a limited amount of time before it is to be terminated.
2. A
child task in the 'suspended' state may or may not have a PWS pending licensed user count. However, a
child task in a 'suspended' state does use OS system resources where the PWS server is executing.
3. Changes
to this keyword take affect when a new user logon occurs which creates a new child task.
Note for PWS Licensing State Flags:
1. If a child task
is in the 'idle' or 'suspended' state, the task's pending license count can be reused by the PWS server
when a client logon request is received.
2. If a child task
to become active again and there is no PWS pending or new user license available for it, an appropriate
error is generated at the client browser and the child task is terminated.