TRANSACTION的执行过程
When a TRANSID enters the CICS system
1. Transaction Manager (XM) search the Program Control Table (PCT) to validate the TRANSID. The PCT contains an entry for each valid TRANSID, as well as the name of program required to process such a transaction.
2. XM then calls the Storage Manager (SM) to create control block called the Task Control Area (TCA) to keep track of task processing. A separate TCA is associated with each task.. Once a TCA has been create for the task, it is Ready to Execute.
3. XM selects a task that is Ready to Execute, it sends the task to another CICS component called the Dispatcher. CICS stores a pointer to the TCA of the currently dispatched task in the Common System Area (CSA).
4. When a task is dispatched for execution, control is passed to the Program Manager (PG). PG searches the Program Processing Table (PPT) for the name of the module to receive control. The PPT contains an entry for each program module and specifies:
l The name of the module
l Its virtual storage location, if already loaded
l Its location in the application program library
If the target application is already loaded into virtual storage, the PG passes control to it and allows it to execute as required. If the program is not already loaded, the PG locates it in the program library and loads it into virtual storage before passing control to it.
5. When the currently executing program module terminates, the PG again receives control and determines what to do next.
Multitasking
During processing, a task alternates among three different states:
l Ready to Execute
l Executing
l Waiting
1. Once a TCA has been created for the task, it is Ready to Execute. Several tasks may be Ready to Execute at one time, and the XM orders them according to their CICS-assigned priority status.
2. The task which has the highest priority will execute immediately.
3. While a task is executing, it has control over the CPU. When the task requires CICS to perform a service on its behalf (e.g. to read in some data), the task give up control of the CPU and waits for the request service to complete. At this stage the task is Waiting.
4. While the first task is Waiting, the next task that is Ready to Execute can be executed. This is how CICS performs multitasking.