Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First, try to understand the concept of 'process' and 'thread'. A thread is a basic unit for execution: a thread is scheduled by operating system and executed by CPU. A process is a sort of container that holds multiple threads.</p> <ol> <li><p>Yes, either multi-processing or multi-threading is for parallel processing. More precisely, to exploit thread-level parallelism.</p></li> <li><p>Okay, multi-threading could mean <strong>hardware multi-threading</strong> (one example is HyperThreading). But, I assume that you just say multithreading in software. In this sense, CPU should support context switching.</p></li> <li><p>Context switching is needed to implement <strong>multi-tasking</strong> even in a physically single core by time division.</p></li> <li><p>Say there are two physical cores and four very busy threads. In this case, two threads are just waiting until they will get the chance to use CPU. Read some articles related to preemptive OS scheduling.</p></li> <li><p>The number of thread that can physically run in concurrent is just identical to # of <strong>logical processors</strong>. You are asking a general thread scheduling problem in OS literature such as round-robin..</p></li> </ol> <p>I <strong>strongly</strong> suggest you to study basics of operating system first. Then move on multithreading issues. It seems like you're still unclear for the key concepts such as context switching and scheduling. It will take a couple of month, but if you really want to be an expert in computer software, then you should know such very basic concepts. Please take whatever OS books and lecture slides.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload