gopi bhimavarapu wrote:
Hi
Can anyone tell me what is wrong with this program.
It is always crashing at thread # 24068.
By that, do you mean that you will have 24068 threads running
concurrently? I wouldn't expect you to be able to create and use so many
threads. The stack space needed for them alone would be a problem, even
ignoring other limited resources on the platform you might be using. If
they each have a 64K stack, which would not be unreasonable, you'd be
allocating 1500MB of address space.
I cannot imagine a task for which having 24068 threads would be useful.
The execution time will be dominated by task switching overhead.
Cheers,
Nicholas Sherlock