Check out "CPU Timer" in the Principles of Operation. Charles
-----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of Charles Mills Sent: Saturday, October 19, 2019 12:47 PM To: [email protected] Subject: Re: Best way for a task to give up the CPU and let other tasks run? Thanks! I suppose some encryption algorithm for which there was no hardware assist available might be a more practical real-world scenario. > Is there something in the dispatcher that is on a timer that ends up saying > this task has gotten enough CPU and it's time to move to the next TCB? In my way imperfect understanding, yes. I believe there is a hardware feature now wherein MVS can say "give me an interrupt when this CPU has run for nnn CPU microseconds" or something similar. If not, then most operating systems have a concept of the time slice: we will let set a hardware timer for nnn real-time microseconds and when the timer goes off, re-evaluate our scheduling algorithm. Charles -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of Tom Brennan Sent: Saturday, October 19, 2019 12:37 PM To: [email protected] Subject: Re: Best way for a task to give up the CPU and let other tasks run? Great descriptions! I was thinking of the PI calculation myself because that's a case where you're doing real work, but the loop could be coded with no I/O and no SVC calls (which would give up control). Now here's a case I thought about in the past: Assuming I'm running such a PI calculation (non-supervisor, interrupts enabled), what is it that eventually interrupts my running code? Of course there are previous I/O completions from other tasks or CP's, but imagine (maybe on a specialized system?) there's nothing much else going on. Is there something in the dispatcher that is on a timer that ends up saying this task has gotten enough CPU and it's time to move to the next TCB? ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
