IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Task priority in CICS


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dipakgoyal
Warnings : 1

New User


Joined: 02 Aug 2007
Posts: 18
Location: Kolkata

PostPosted: Mon Oct 13, 2008 7:52 pm
Reply with quote

I read in a the site:

publib.boulder.ibm.com/infocenter/cicsts/v3r1/index.jsp?topic=/com.ibm.cics.ts31.doc/dfht3/dfht34w.htm

that
"
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?
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Mon Oct 13, 2008 9:37 pm
Reply with quote

Quote:
But CICS supports multitasking. So if all the tasks are running concurrently, how does the concept of "PRIORTIZING THE TASKS" come?


This does not mean they are running truely concurrently. Tasks are
single thread and have control between CICS service calls.
Back to top
View user's profile Send private message
dipakgoyal
Warnings : 1

New User


Joined: 02 Aug 2007
Posts: 18
Location: Kolkata

PostPosted: Tue Oct 14, 2008 11:37 am
Reply with quote

I got the meaning of
" Tasks are single thread "

but I am not clear about
"This does not mean they are running truely concurrently"

Does it mean that if 2 or more tasks uses "CICS service calls", they do it serially?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Oct 14, 2008 11:55 am
Reply with quote

Hello,

Quote:
Does it mean that if 2 or more tasks uses "CICS service calls", they do it serially?
There is some amount of serialization, but overall cics tasks are interleaved, giving the appearance of concurrent execution.
Back to top
View user's profile Send private message
dipakgoyal
Warnings : 1

New User


Joined: 02 Aug 2007
Posts: 18
Location: Kolkata

PostPosted: Tue Oct 14, 2008 12:12 pm
Reply with quote

Thanks Earl and Dick

But my first doubt stand as it was

1. ) We are clear that tasks will be assigned priority. But when is this priority used?

2.) "but overall cics tasks are interleaved, giving the appearance of concurrent execution"

Are you talking about pseudo-coversational approach?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Tue Oct 14, 2008 5:04 pm
Reply with quote

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.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Oct 16, 2008 3:22 am
Reply with quote

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.

But, the benefits are worth it....

Regards,

Bill
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts Calling an Open C library function in... CICS 1
No new posts How to 'Ping' a CICS region in JCL CICS 2
No new posts Parallelization in CICS to reduce res... CICS 4
No new posts How to avoid duplicating a CICS Web S... CICS 0
Search our Forums:

Back to Top