Click here to Skip to main content
15,940,550 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Iam doing term project, Benchmarking multhreaded performance in linux andin windows.

In linux I wrote simple program to create threads, where I was able to create 30,000 threads.
It worked fine.

I wrote a program for measuring context switch time,I implemented ping pong game for measuring context switch time.
I am unable to create 1000 threads even if I set stack size to 32kb. Iam getting 11! error.
What might be the reason.

Updated 24-Nov-12 4:35am
Richard MacCutchan 24-Nov-12 10:39am    
What is "11! error"?
Nelek 24-Nov-12 10:42am    
Please don't think we can read minds or do astral projections to see your monitor. If you need help, the least you could do is to add some relevant code to your question or to explain your problem in such a way, that the users of CP can understand it. Otherwise, nobody will be able to help you.
You say you get 11 errors, but not which kind of errors, you don't show your code for the creation or things that could help people helping you.
CPallini 24-Nov-12 11:51am    
Code, we need code, Watson.
Chuck O'Toole 24-Nov-12 18:39pm    
32KB is a very small stack these days, think in terms of MB

1 solution

If I remember correctly... Linux doesn't have a per process limit on number of threads whereas Windows does. If I remember that correctly, logic would say the number of threads in a process allowed in Windows would be a lot smaller than that allowed in Linux. You should probably look that up though to verify.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900