431 likes | 1.13k Views
CA-IDMS Task Management. Presented by Manfred Hoefer Computer Associates UKIUA ROADSHOW 2004. Agenda. Overview of Online Task Management Starting Online Tasks Life Cycle of an Online Task. What Is an Online Task. Identifies the user request for work Operating system task vs. DC task
E N D
CA-IDMS Task Management Presented by Manfred Hoefer Computer Associates UKIUA ROADSHOW 2004
Agenda • Overview of Online Task Management • Starting Online Tasks • Life Cycle of an Online Task
What Is an Online Task • Identifies the user request for work • Operating system task vs. DC task • Wait driven processing • Interrupt driven processing • Information about request gathered and placed in control blocks: • Program to execute • Priority of request • User security levels
Types of Tasks • Four types of tasks: • System tasks • External user requests • Interactive tasks • Conversational • Pseudo-conversational • Background tasks
System Tasks • MASTER • DBRC • Line driver tasks • Service tasks • Database services • Dictionary run-unit services • Deadlock detection • AdvantageTM CA-IDMS® Database Performance Monitor Option statistics collection • Factotum tasks • Helot tasks
Task Management • Identifies each user request as a task • Keeps track of task status • Determines which task is allowed to process
Starting Online Tasks • Task control overview • Task control data structures • Task control processing routines • Attaching a task • MASTER task processing • Background task overview • Timer-initiated tasks • Startup and Shutdown autotasks • Queue Threshold tasks • Attaching a task from an application • LTE acquisition & task ownership
Task Control Processing • Maintains a list of active tasks • Attaches new tasks to process user requests • Determines task priority and ensures proper security • Passes control to the application program • Terminates a task • Limits task utilization of system resources
Task Control Data Structures • Logical Terminal Table — LTT • Logical Terminal Element — LTE • Task Definition Table header — TDT • Task Definition Element — TDE • Task Table Search Index — TIX • Task Control Area header — TCA • Task Control Element — TCE
Task Control Components • RHDCMSTR • RHDCDBRC • RHDCTSKC • RHDCWAIT • RHDCTSKI • IDMSTMGR
Active Tasks • MAXIMUM TASKS • MAXIMUM ERUS • Number of LINE statements • Plus two for system tasks — MASTER and DBRC • Plus one for each service driver • Plus one for Print task • Active task chain anchored at CSADCEFA
Attaching a Task • #ATTACH macro • Acquire a TCE • Add to dispatch list • Return control • ECB can be used to delay initial dispatch
Processing Interactive Tasks • Terminal control • Terminal ownership • Master’s Ready Queue • Handling all terminals
Processing a Ready Terminal • A dead terminal • A new signon • LTENXTSK • LTEAUTSK • Task code entered on terminal • Previous task abended • No task code or line I/O session • Task code is available • Task is an INPUT task and no input is available • Task is a NOINPUT TASK or input is available • Master processes all ready terminals
A Typical Interactive Processing Cycle • First connection to DC • Line driver posts LTTMSECB • Master sets LTEALIV and attaches factotum • Factotum writes ENTER NEXT TASK CODE and issues read • Factotum task terminates; MASTER waits on PTERECB • Terminal operator enters task code • Master finds TDE and attaches task
A Typical Interactive Processing Cycle (cont'd) • Task terminates with DC RETURN NEXT TASK CODE • LTE is put on MASTER’s queue • Master finds TDE but input isn’t available • Operator hits enter • Line driver posts PTERECB • Master starts new task
Background Task Overview • Timer-initiated tasks • Queue Threshold tasks • Startup and Shutdown autotasks • Application started tasks
Timer-Initiated Background Tasks • Interval Control Element - ICE (#ICEDS) • Three types of timer functions • WAIT • POST • START • TICKER functions
Queue Threshold Tasks • Queue name • TDE of task to start • Number of records currently in the queue • Threshold count • RHDCQUEM attaches task • IDMSTMGR calls RHDCQUEM to post the ECB when queue update is committed
Autotasks • Defined in Sysgen • Startup autotasks attached by Master after Print task • Can preempt any other user tasks • Master attaches shutdown autotasks after other tasks are done • Master attaches LTE autotasks instead of writing ENTER NEXT TASK CODE
Attaching a Task from an Application Program • #ATTACH from assembler program • ATTACH from COBOL or PL/I • Processed like attach by system program • ECB parm can delay initial dispatch
Life Cycle of an Online Task • Attaching a task • Task initialization • Task termination • Making system requests from an application • Entering and re-entering user mode • Limiting a task’s resource utilization
Attaching a Task • Task creation done by RHDCTSKC • Locates the first available TCE/DCE pair • Initializes the DCE and TCE • Assigns task priority • For ERUS tasks, associates a TDE with the task • Allocates a dynamic LTE for background tasks • Calculates task priority and assigns task limits
Attaching a Task (cont'd) • Places the DCE on chain waiting for initial dispatch • Sets a pointer in the TCE to INITLINK or to nucleus entry point • Returns to the program/module which issued the ATTACH
Initial Dispatch • RHDCWAIT • Removes the DCE from the TCANEWT chain • Places the DCE on the active task chain • Initializes Register 9 to point to the new TCE • Initializes Register 13 to point to the beginning of the stack • Calls RHDCTSKI to initiate the task
Task Initialization • RHDCTSKI • Moves long-term resources from LTE to TCE • Moves task limit information from TDERLB to TCERLB • Sets up task initialization statistics • Calls PERFMON to record tasks initialization • Calls Exit 4 • Calls the task’s entry point
Invoking the Initial Program • The INITLINK routine • Allocates an LTE for some background tasks • For ERUS tasks, links to IDMSTASK • For online tasks, uses TCE->TDE->PDE • Issues #LINK to application program
Program Control (RHDCPCTL) • Entered at PCTLLINK • Sets indicators in the TCE • Calls RHDCLODR to locate or load program • Calls RHDCPCBO to perform setup for COBOL • Calls RHDCPPLO to perform setup for PL/I • Calls RHDCLE37 to perform setup for LE • Sets register values in TCERSA • Branches to entry point WAITEPI in RHDCWAIT
Transition to User Mode • WAITEP2I • Sets up TCEPMASK • Sets R8 to point to CSAUMOD1 within RHDCCSA • Branches to GOTOUSER
Entering and Reentering User Mode • GOTOUSER • Page list for storage protected memory • Computes time in system mode • Turns on SVC screening if needed • Copies the user mode registers from TCERSA to the SCA • Sets TCEUSER and SCAUSER • Invokes Advantage CA-IDMS SVC if protect in effect • Branches to CSAUMOD1 or CSAUMOD2
Making System Requests • Application program controls registers and CPU • Entry via CSA for system request • CSA routine branches to WAITEP2 • Set the PSW program mask • Saves the applications program’s AMODE • Copies user mode registers • Updates R14 in the RSA
WAITEP2 processing • Set the PSW program mask • Save the application program’s AMODE • Save user mode registers • Calculates CPU time in user mode • Turns off SCAUSR • Calls WAITEP5 (security check) • Writes a trace entry to log if USER TRACE • Calls RHDCLIMT • Calls appropriate processing routine • Returns to user mode via GOTOUSER
Terminating a Task • DC RETURN or #RETURN • PCTLRTN routine • Processes any parameters specified on the return to: • Set LTENXTSK • Set LTESRPGM • Set LTERSINT • Set LTENTPC • Release the application program (#DELETE) • Pass control to entry point TSKIEP2 within RHDCTSKI • System task does a #RTN
Task Termination Processing • TSKIEP2 • Call RHDCFLTR for dynamic LTE • Call IDMSTMGR to perform task end events • Set up task statistics • Call Exit 5 • Call PERFMON to record task end event • Get ERUS statistics • Write statistics to the log
Task Termination Processing (cont'd) • Call Exit 6 • Move long term resources from TCE anchors to LTE anchors • Set LTEMSTR • Put LTE on Master’s ready queue • If suspended ERUS LTE, post ESEECB to wake up DBRC • If dynamic LTE without LTENXTSK, free the LTE • Pass control to WAITEP1R in RHDCWAIT
Detaching a Task • WAITEP1R • Remove DCE from the active task chain • Place TCE/DCE pair on the free task chain • Post TCAECB • Branch to DISPATCH to find another task to dispatch
Session Summary A Few Words to Review • DC/UCF functions like an operating system • Master task manages interactive terminals • Non-interactive tasks can be created • Application has control of system while in user mode (subject to security restrictions)