Prioritization is a method of giving specific tasks preference in being dispatched.
Priority is specified by terminal in:
A CEDA TERMINAL definition (TERMPRIORITY)
A transaction in a CEDA TRANSACTION definition (PRIORITY)
A user in the priority field of the user segment of the external security manager (ESM), (OPPRTY).
The overall priority is determined by summing the priorities in all three definitions for any given task, with the maximum priority being 255.
TERMPRIORITY+PRIORITY+OPPRTY <= 255
The value of the PRTYAGE system initialization parameter also influences the dispatching order; for example, PRTYAGE=1000 causes the task's priority to increase by 1 every 1000ms it spends on the ready queue.
But CICS supports multitasking. So if all the tasks are running concurrently, how does the concept of "PRIORTIZING THE TASKS" come?
In other words, if a processor can execute only 1 task at a time, then it executes more important task first and then lesser important task. But if all tasks can run simultaneously, what to priortize?
Joined: 06 Jun 2008 Posts: 8280 Location: Dubuque, Iowa, USA
OK, CICS is being given a CPU time slice by z/OS. Since the last CPU time slice, user A on terminal A001 has entered transaction ABCD, user B on terminal B001 has entered transation ZYXW and an interval controlled task has tripped its timer. You have 3 tasks ready to run but only one CPU on which to run them. How does CICS determine which task to start? Answer: the task priority; if ZYXW transaction has a task priority higher than the other two, CICS starts processing the ZYXW transaction. If this transaction finishes and there's still time, or at the next CPU time slice, CICS looks at what work is ready to run and again picks the highest priority task to work on, and so forth.
Which explains both questions -- the interleaving doesn't really have anything to do with pseudo-conversational, which is a way to write the application interaction with the terminal. The interleaving is at a much lower level.
Joined: 14 Jan 2008 Posts: 2504 Location: Atlanta, Georgia, USA
If you're running an OPEN API environment and your programs are Threadsafe or if you're running DB2 and your programs are Threadsafe, then, this is an example of how two or more tasks can run concurrently, with the QR TCB delegating work to the L9 (OPEN API) and L8 (DB2) Threadsafe TCB's. These tasks may have delegated by the QR a microsecond behind each other, but for all practical purposes, they are executing at the same time (IE: Concurrently). Also, by having these Threadsafe environments, the QR can move along (delegate) at a much quicker pace.
Note that when you define a program in the PPT as Threadsafe, then this is a promise you're giving to CICS that the given program passes all the requirements to be Threadsafe. CICS does not go out of its way to ensure the program is Threadsafe.
Some of our colleagues on this Board may have had some "opportunities" in their shops when a given program was PPT-defined as Threadsafe, but it really wasn't, such as raising a S0C1 on a CLI or MVI instruction (this will leave you with your head scratching) in the transaction dump.
Initially, Threadsafe can be a wild beast to tame. But once the given program has met all of the requirements, you'll find an enormous boost in throughput, especially with DB2/SQL queries.
Please note that this is merely an explanation for Threadsafe concepts and should a shop venture into this area, up front research and stringent testing will be the order of the day as Threadsafe applications and compliance, which will eventually blossom into Threadsafe regions/systems, are not to be taken lightly.