From: Peter Duniho on 8 May 2010 16:08 Family Tree Mike wrote: > [...] > I am pretty sure question two contains a typo. The question would make > reasonable sense if it said "computer with a single processor". See my reply to Mihajlo. The rest of Tony's question includes similarly nonsensical scenarios. Why should we think that he's not literally suggesting only a single process running? Especially when he also writes "how many threads exist for this process", and clearly understands that processes own threads. Pete
From: Tony Johansson on 8 May 2010 17:22 "Mihajlo Cvetanovic" <mcvetanovic(a)gmail.com> skrev i meddelandet news:eWUHsxs7KHA.3504(a)TK2MSFTNGP05.phx.gbl... > On 5/8/2010 3:02 PM, Tony Johansson wrote: >> Question 1: So will this process having four Threads be give one time >> slice >> to each of its Threads ?? > > Operating system deals with threads, not with processes. Processes are > just a sort of containers for threads. So, each of those 13 threads will > be given one time slice. > >> Question 2: I have the understanding that if you have a computer with a >> single process no more then one thread can be executing at any single >> time >> so matter how many threads exist for this process. >> Is that correct understood ? > > I believe you meant "single processor", not "single process". The answer > to your question is yes, at any single time at most one thread is > running on one processor. You are understanding me correct !! //Tony
From: Peter Duniho on 8 May 2010 17:32 Tony Johansson wrote: > [...] >>> Question 2: I have the understanding that if you have a computer with a >>> single process no more then one thread can be executing at any single >>> time so matter how many threads exist for this process. >>> Is that correct understood ? >> >> I believe you meant "single processor", not "single process". The answer >> to your question is yes, at any single time at most one thread is >> running on one processor. > > You are understanding me correct !! Then you misunderstand how processors (or more precisely, CPU cores) and threads work. Threads do not "exist for a processor". Any given thread can only be executing on any one CPU core at a time, but it can be scheduled for execution on any CPU core present (*). (*) (For advanced multi-threading, it is actually possible to restrict a thread to a specific CPU, but this is not normal behavior, nor is it usually the right thing to do). Note also that, speaking precisely, you are incorrect to say that no more than one thread can be executing on a processor at once, since a processor can (and for modern computers almost always does) include two or more cores. It is the number of cores that's important, not the number of CPUs. Pete
First
|
Prev
|
Pages: 1 2 Prev: accessing public members of a .net asembly exe Next: terminologi instaniating |