Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
greyfade2137yIt's called "processor affinity," and it doesn't have the effect you think.
Operating systems run programs on whichever core is sitting idle. Affinity is only useful for saying, "plz to not preempt." -
@greyfade then how can it be that a single core game like Rollercoaster tycoon 2 seems always to use CPU0 on multicore systems? On my fx8320 when playing CPU 1-7 is nearly idle while 0 is under heavy load...
I know that this is a game not able to multithread. But why isn't the OS giving another core? Or is itself switching the cores because something singlethread runs?
And some programs like audio converters simply grab one track per CPU core during conversion I've recognized.... -
greyfade2137y@paradonym sorry for slow reply.
The game may be setting affinity (which is a trivial function call) or the OS simply has no reason to schedule the game on another core.
Process scheduling is a bit of a black art, but granting affinity to a process is a common scheduling strategy that is meant to minimize scheduling interrupts, which are often expensive.
Related Rants
Wouldn't it be clever if a programmer decides to code his programs the way so that they always use the last CPU core available?
I mean: on 8-core: CPU 7 > CPU 6 > CPU 5...
I mean, if every other program is used to start using CPU 0 and then to move upwards... This could be an advantage...
question
cpu
multitasking