Re:A Gentle Introduction to Multithreading
by mav3rick on Monday March 11, 2019 @08:34PM
(#19364311)
You can do a set affinity on Linux but it isn't a guarantee.
Why would you want to override the scheduler like that? That would also mean not scheduling your process until all the CPUs were clear, and greatly increasing scheduler coordination overhead. So it would decrease overall work throughput.
CPU affinity is genuinely useful, but I can't see why you'd want this kind of temporal affinity. Especially since you could have different CPUs running at different speeds!
Re:A Gentle Introduction to Multithreading
by renholder on Monday March 11, 2019 @08:38PM
(#19364334)
>Are there any operating systems that let you explicitly run CPUs in parallel?
That's a good question. I don't have the answer, to be sure, but I would think part of the problem is conflicting priorities and who would "win" in that scenario.
CUDAs in a GPU might be more worthwhile for that approach, maybe, but I could also be talking out of my arse, here...
I'm thinking n threads where the process requests the operating system scheduler to start and stop them all at the same time. Of course the OS would be permitted to refuse if it wasn't capable (or just not allowed).
A synchronised cpu master-slave relationship could be beneficial to parallelize some of the middle ground between instruction level parallelism and multi-threading