Threads Handling
-
And also it cannot cross one more limit, the numbers that can uniquely represented by the Value of HANDLE, Say HANDLE is a 32 bit value, then 2 power 32 is the limit as each thread is represented by a HANDLE. :)
Are you kidding?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
[my articles] -
Are you kidding?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
[my articles]I was, I am not sure, but since thread is represented by HANDLE, the number of threads also depends on this data Isn't it? I agree hardware resource will retrict. but assume if infinite hardware, then comment on the above
-
I was, I am not sure, but since thread is represented by HANDLE, the number of threads also depends on this data Isn't it? I agree hardware resource will retrict. but assume if infinite hardware, then comment on the above
Rajkumar R wrote:
I am not sure, but since thread is represented by HANDLE, the number of threads also depends on this data Isn't it?
Of course.
Rajkumar R wrote:
I agree hardware resource will retrict. but assume if infinite hardware, then comment on the above
Assuming infinite hardware, you may have even a bigger number of thread, since HANDLE definition is
typedef PVOID HANDLE;
i.e. architecture dependent. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
[my articles] -
Rajkumar R wrote:
I am not sure, but since thread is represented by HANDLE, the number of threads also depends on this data Isn't it?
Of course.
Rajkumar R wrote:
I agree hardware resource will retrict. but assume if infinite hardware, then comment on the above
Assuming infinite hardware, you may have even a bigger number of thread, since HANDLE definition is
typedef PVOID HANDLE;
i.e. architecture dependent. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
[my articles]Yes, I mean even if we have enough h/w resource (not infinite) that can run more than 2 power 32 threads (I think this is possible, what do you say?) on machine in which PVOID is 32 bit, the HANDLE is restricting isn't? :)
-
Yes, I mean even if we have enough h/w resource (not infinite) that can run more than 2 power 32 threads (I think this is possible, what do you say?) on machine in which PVOID is 32 bit, the HANDLE is restricting isn't? :)
Well, on such a machine, a kind of thread-handle-bank-switching will be required! (i.e. the revenge of the INTEL 16 bit architecture) :laugh:
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
[my articles] -
And also it cannot cross one more limit, the numbers that can uniquely represented by the Value of HANDLE, Say HANDLE is a 32 bit value, then 2 power 32 is the limit as each thread is represented by a HANDLE. :)
Rajkumar R wrote:
HANDLE is a 32 bit value, then 2 power 32 is the limit as each thread is represented by a HANDLE
Thread HANDLEs and many other kernel object HANDLEs are always a multiple of 4 because the last two bits of the HANDLE are always zero. The last two low order bits can be used as TAG bits. Best Wishes, -David Delaune
-
Well, on such a machine, a kind of thread-handle-bank-switching will be required! (i.e. the revenge of the INTEL 16 bit architecture) :laugh:
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
[my articles]thread handle bank also does have limit :-D only we can increase the limit :)
-
Rajkumar R wrote:
HANDLE is a 32 bit value, then 2 power 32 is the limit as each thread is represented by a HANDLE
Thread HANDLEs and many other kernel object HANDLEs are always a multiple of 4 because the last two bits of the HANDLE are always zero. The last two low order bits can be used as TAG bits. Best Wishes, -David Delaune
so it is even less 2 power 30 :)
-
Hi, Can anyone let me know how many threads can be run at a given point of time? Ranjini
modified on Monday, February 04, 2008 7:56:19 AM
One thread per processor is all the threads that can run at a given point of time. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
One thread per processor is all the threads that can run at a given point of time. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
It is not valid for HT (Hyper threading) machine, one processor multiple execution chain :)
-
Meaning the total number of threads that the OS can support, or the total number of threads that your app can launch successfully? I believe that the former is limited by the amount of resources available to the OS (having 4GB installed means nothing if only 256MB are used internally by the OS). The latter is limited much the same, except that it also gains a limitation from the application itself. Since a thread's stack space comes from the address space of the process, you can create enough threads that you run out of available thread space. You can do the same thing by creating threads without cleaning them up (or closing their handles) - the address space used by the thread will not get recovered, and even though you have memory available, you have "no place to put it." Peace!
-=- James
Please rate this message - let me know if I helped or not! * * *
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
See DeleteFXPFilesHi, Firstly, Thanks for your reply. It is helpful. Yes I meant The total number of threads that my app can launch successfully. Say if I have 1,00,000 threads quequing up, will my app be able to handle it? Thanks in Advance Ranjini
-
Hi, Firstly, Thanks for your reply. It is helpful. Yes I meant The total number of threads that my app can launch successfully. Say if I have 1,00,000 threads quequing up, will my app be able to handle it? Thanks in Advance Ranjini
Member 4116875 wrote:
Yes I meant The total number of threads that my app can launch successfully. Say if I have 1,00,000 threads quequing up, will my app be able to handle it?
You can have a try now! ;) (Remember that 1: 'suspended', 2: 'resumed' with WaitForXXObject, and 3: 'resumed' with Sleep(n) are different. )
Maxwell Chen
-
It is not valid for HT (Hyper threading) machine, one processor multiple execution chain :)
Fine...I'll include logical processors in the list of processors as well ;P Mark
Mark Salsbery Microsoft MVP - Visual C++ :java: