Click here to Skip to main content
11,935,467 members (63,034 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++ Linux
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.

Posted 24-Nov-12 5:17am
Edited 24-Nov-12 5: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
Albert Holguin 25-Nov-12 1:20am
He's doing that to try to squeeze the system for more threads...

1 solution

Rate this: bad
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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100