multithreading - How are multiple CPU cores used by the OS -



multithreading - How are multiple CPU cores used by the OS -

there lot of articles discuss multi-core myth. that, in order benefit multiple cores, 1 needs write parallel algorithms. many of them mention amdahl's law.

lets assume simplicity have desktop computer 4-core commodity cpu. , assume goal improve our application performance, overall scheme performance.

i wonder how cpu cores used perform tasks.

whether threads single process allocated cores or threads different processes scheduled run on different cores.

if latter case, why myth discussed? won't multitasking oses benefit multi-core cpus, if processes single threaded? threads same process more scheduled @ same time on multiple cores?

what factors matter? cpu cache maybe? application related maybe? why? why ever want utilize parallel libraries/algorithms? after all, cpu resources shared between running processes , there plenty of them.

is there "active process" notion? i.e. process gets attending scheduler. if so, how much more attending process get?

whether threads single process allocated cores

yes.

or threads different processes scheduled run on different cores.

yes, too.

if latter case, why myth discussed? won't multitasking oses benefit multi-core cpus, if processes single threaded?

to extent, yes. if process doing lot of computation , 1 care @ particular time, benefit pretty low.

on other hand, means process won't interrupted because os has handle disk interrupt, arriving network packet, or that. interrupting process handle hardware task not cut down cpu time process gets pollutes cpu caches causing process run more when resumes. multi-core cpus can allow single-threaded process command core higher percentage of time , in longer bursts.

are threads same process more scheduled @ same time on multiple cores?

typically no. why want that? tend degrade overall scheme performance threads same process more step on each other's toes. want scheme other process' work done efficiently cpu back.

is there "active process" notion?

to extent. windows has exactly such notion -- "foreground process". oses don't. have "dynamic priority boost" feature. basically, if process sitting around doing nil , needs something, given priority "reward". allows process sits around waiting work done work done , makes scheme sense more interactive , responsive. makes little sense on servers, it's helpful on desktops. whether implemented on threads individually or on threads of process grouping implementation specific.

multithreading performance operating-system multicore

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -