Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++Linux
Hi ALL,
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.
 
Thanks.
Posted 24-Nov-12 4:17am
Edited 24-Nov-12 4:35am
v2
Comments
Richard MacCutchan at 24-Nov-12 10:39am
   
What is "11! error"?
Nelek at 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 at 24-Nov-12 11:51am
   
Code, we need code, Watson.
Chuck O'Toole at 24-Nov-12 18:39pm
   
32KB is a very small stack these days, think in terms of MB
Albert Holguin at 25-Nov-12 1:20am
   
He's doing that to try to squeeze the system for more threads...

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Guruprasad.K.Basavaraju 490
1 Shai Vashdi 339
2 Sergey Alexandrovich Kryukov 291
3 Peter Leow 135
4 praveen_07 115
0 Sergey Alexandrovich Kryukov 9,185
1 OriginalGriff 5,335
2 Peter Leow 4,040
3 Maciej Los 3,540
4 Abhinav S 3,308


Advertise | Privacy | Mobile
Web02 | 2.8.140415.2 | Last Updated 25 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid