• Aucun résultat trouvé

148 CICS/vS Application Programmer's Reference Manual

Dans le document Program Product (Page 167-171)

-DFHKC TYPE=ATTACH

For

ANS

COBOL:·

MOVE 'TRN1' TO TCAKCTI.

MOVE FACADR TO TCAKCFA.

DFHKC TYPE=ATTACH

!2!:

~:

TCAKCTI=' TRN1';

TCAKCFA=FACADR;

DFHKC TYPE=ATTACH

INITIATE NEW TASK

NOTE TRANSACTION IDENTIFICATION.

NOTE USER'S FCA ADDRESS.

INITIATE NEW

~ASK

/*TRANSACTION IDENTIFICATION*/

/*USER'S FCA ADDRESS*/

/*FACADR IS A POINTER VARIAELE*/

INITIATE NEW TASK

148 CICS/vS Application Programmer's Reference Manual

If Task 'B' is higher in priority it becomes active here.

TASK A

Attach Task B and Point FCADDR

toTCA

Wait on ECB1 (Note 1)

If Task 'B' is lower - in priority it becomes

active here.

Task' A' is aware if - - - - - - Task 'B' completed Processing Step 1.

Processing Step 2

Post ECB2

Give Up Control By a Wait or PC Return

Page of SH2Q-9003-2 Revised May 22, 1975 By TNL SN2Q-9086

Task 'B' is aware of completion

TASK B

Obtain Address of ECB1 and ECB2 by

Use of Address Now in TCAFCAAA

,

..

Processing Step 1

"

Post ECB1 to Make Task 'A' Dispatchable

Wait on ECB2 (Note 2)

Task 'B' gives up control here.

of both Step 1

and Step 2. Task 'B' regains

control here.

Processing Step 3

Note: If Task B is not attached (e.g. Trans I D not in PCT), or if Task B ABEND, ECB 1 may never be posted.

Note 2: If Task A ABEND, ECB2 may never be posted.

Figure 6-9. Task Synchronization under CICS/vS

RESCHEDULE A 3650 TASK (SCHEDULE)

During operation with a 3650 system, i t may be necessary to reschedule an autamatic- or time-initiated task rejected because of

Page of SH2D-9003-2 Revised May 22,1975 By TNL SN20-9086

insufficient resources in the 3651. Such a task can be rescheduled for operation by issuing the

DFHKC TYPE=SCHEDULE

macro instruction. This macro instruction causes the task to be rescheduled and another attempt is made to initiate execution.

CHANGE PRIORITY OF A TASK (CHAP)

The overall transaction processing priority of a task is the sum of related transaction, terminal, and operator priorities as specified or established by default at system generation. This priority determines the position of the task in the dispatching priority queue and,

therefore, its scheduling under CICS/vS. The priority of an existing task can be changed by issuing the

DFHKC TYPE=CHAP,

macro instruction. The specified priority value must be in the range from 0 through 255, where 255 represents the highest priority. This task is placed below all other tasks of equal or higher priority in the dispatching priority queue.

The application programmer can include the PRTY=priority value operand in the DFHKC TYPE=CHAP macro instruction to assign a new dispatching priority to a task. Alternatively, the programmer can assign a priority value to the dispatching priority field (TCATCDP) prior to issuing the DFHKC TYPE=CHAP macro instruction.

A task can voluntarily relinquish control to all tasks of equal or higher priority by issuing a

DFHKC TYPE=CHAP

macro instruction. No priority value is specified, and the current priority value of the task as stored in TCATCDP is not changed.

However, the fact that the macro instruction is issued permits control to be transferred from the task issuing the instruction to an equal or higher priority task within CICS/VS. This capability is designed particularly for compute-bound tasks which, by continually demanding inordinate amounts of CPU time, can significantly affect overall system performance.

The following example shows how to statically assign a new task dispatching priority value:

*

DFHKC TYPE=CHAP, PRTY=255

CHANGE PRIORITY OF THIS TASK

NEW PRIORITY VALUE

*

The following examples illustrate the coding required to assign a dynamically selected priority value. This value can be specified as a binary, decimal, or hexadecimal number, depending on the programming language used.

~ Assembler language:

MVI TCATCDP,XIFF' ASSIGN NEW PRIORITY VALUE

Chapter 6. Service Invocation 149

r--- - DFH'KC TY~CHAP--- - CHANGE PRIORITY OF THIS TASK . -For ANS COBOL:

MOVE

'*'

TO TCATCDP. NOTE ASSIGN NEW PRIORITY VALUE.

, *. IS A MULTIPUNCH 12-11-0-7- 8- 9.

DFHKC TYPE=CHAP CHANGE PRIORITY OF THIS TASK For PL/I:

TCATCDP=255; /*ASSIGN NEW PRIORITY VALUE*/

DFHKC TYPE=CHAP CHANGE PRIORITY OF THIS TASK SYNCHRONIZE A TASK (WAIT)

The application programmer can synchronize a task with the completion of an event or one of a list of events initiated by the same task or by another task, or voluntarily relinquish control to a task of higher dispatching priority, by issuing the

DFnKC TYPE=WAIT,

macro instruction. In the first case, this macro instruction provides a method of directly relinquishing control to some other task until the event being waited on is comFleted. In the latter case, the task remains dispatchable. That is, execution of the task is resumed if no task of higher priority is ready to be processed.

*

The application programmer must specify the circumstances under

which synchronization of a task is to occur by including the DCI=keyword operand (dispatch control indicator) in the DFHKC TYPE=WAIT macro

instruction.

If the task is to be synchronized with the completion of a single event or an event of a list of events, the application programmer must specify the symbolic address of either the single event control area or the list of" event control areas. The address can be specified by including the ECADDR=symbolic address operand in the DFHKC TYPE=WAIT macro instruction, or by coding a single instruction that places the event control address in TCATCEA prior to issuing the DFHKC TYPE=WAIT macro instruction. In either case, the referenced event control area(s) must conform to the format and standard posting conventions associated with the operating system (for example, ECBs in VS1 or VS2, CCBs in DOS/VS). An event control area can also be the timer event control area referred to in a DFHIC TYPE=POST macro instruction. (S~e the discussion of task synchronization under "Time Services.")

Synchronize ~ Task with ~ Single Event

The DFHKC TYPE=WAIT,DCI=SINGLE macro instruction is used by the application programmer to synchronize a task with the completion of a single event initiated by the same task or by another task.

Page of SH20-9003·2 Revised May 22,1975 By TNL SN20-9086

The following example shows how to synchronize a task with a single

Dans le document Program Product (Page 167-171)