>From the application's point of view -- and you must take this into consideration in designing a multi-task application -- all tasks (TCBs) may run "at the same time" even though there are more tasks than CPUs. If a task loads a word, adds one to it, and stores it back, you have to consider that another task might modify that word between the load and the store -- even if you have only one CPU.
But can more TCBs be "dispatched" than CPUs? No. "Dispatched" means "dispatched on a CPU." So it is by definition one-to-one. You can have more TCBs dispatchABLE than CPUs -- eligible to run were a CPU available. But actually dispatched? No. So you have to design your application on the theory that any two things could happen "at the same time" although in reality they do not really happen at the same time -- they just interleave unpredictably, which is the same thing from an application designer's point of view. The effect of multiple CPUs on a multi-task program is even worse than the load, add, store example above. With two CPUs, it is possible for even single machine instructions to interleave. So if one task executes MVC FOO,=C'Now is the time for all good men to come to the aid of the party' and another CPU executes MVC FOO,=C'The quick brown fox jumps over the lazy dog' it is at least in theory* possible for FOO to end up containing 'Now is the time fox jumps over the lazy dog the aid of the party'. *You would have to know the hardcore machine details of the particular processor model to be certainly exactly what might happen like this, but my basic point is valid. You have to design and code as though this were possible. Charles -----Original Message----- From: IBM Mainframe Assembler List [mailto:[email protected]] On Behalf Of Peter Hunkeler Sent: Sunday, July 30, 2017 8:54 PM To: [email protected] Subject: AW: Question about CPUs >My understanding is a Task (TCB) in an address spaces always requires a CPU to be assigned/associated with. Yes. > So with Logical/Virtual CPUS, can I have more TCBS, actively dispatched at the same time in the same Address Space, than the Physical CPUs ? No. A single physical CP can only execute the instructions of a single TCB (or SRB) at any time. No matter how many logical CPs you assign to an LPAR, the number of physical CPs in your machine limit the number of units of work that can run in parallel, i.e. at the same time. When you define more than one LPAR on your machine, the total number of logical CPs of all LPARs will probably exceed the number of physical CPs by a factor of two to four. And at any point in time, no more units of work than the number of physical CPs in the machine may execute in parallel on all LPARs.
