Slashdot Log In
Running 100,000 Parallel Threads
Posted by
michael
on Sun Sep 22, 2002 12:24 AM
from the when-one-isn't-enough dept.
from the when-one-isn't-enough dept.
An anonymous reader writes "This story explains how the latest Linux development kernel is now able to start and stop over 100,000 threads in parallel in only 2 seconds (about 14 minutes 58 seconds faster than with earlier Linux kernels)! Much of this impressive work is thanks to Ingo Molnar, author of the O(1) scheduler recently merged with the 2.5 Linux development kernel."
This discussion has been archived.
No new comments can be posted.
Running 100,000 Parallel Threads
|
Log In/Create an Account
| Top
| 409 comments
(Spill at 50!) | Index Only
| Search Discussion
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Re:Posix thread... (Score:5, Informative)
http://www.cs.wustl.edu/~schmidt/ACE.html
This is so far the best library I have used for pthread programming. Powerful, easy to use, and encapsulates message passing really well...
Hold this thread while I walk away (Score:3, Funny)
100,000 Linux threads (Score:5, Funny)
Win ME Kicks that sorry statistic!!!! (Score:4, Funny)
Re:Win ME Kicks that sorry statistic!!!! (Score:4, Funny)
I'm only a humble C programmer, but.... (Score:4, Interesting)
Re:I'm only a humble C programmer, but.... (Score:5, Funny)
Re:I'm only a humble C programmer, but.... (Score:5, Informative)
Re:I'm only a humble C programmer, but.... (Score:5, Informative)
I'm not so sure about that.
A threaded model doesn't necessarily offer advantages -- Apache's multiprocess model is really just as good on platforms without serious performance penalties on fork(), and Boa (which neither forks nor threads) is much, much faster than either Apache mode (though of course on SMP systems multiple instances must be run to use all the available CPUs).
Indeed, unless SMP is being taken advantage of, a well-written single-threaded application will always be faster than an equivalent multithreaded application. Such an application has less overhead and is able to jump between its "subprocesses" only when needed -- and without the latencies involved by letting the OS handle said scheduling. Back in the Real World, I still write threaded code -- but because writing unthreaded code (in the problem spaces where threads are useful) is harder, not because it's faster.
If you want to destroy my boxen. . . (Score:3, Funny)
OK I'll shut up now.
Parallelism (Score:5, Interesting)
Re:Not 100,000 threads in parallel, just 50. (Score:5, Informative)
Yeah right. And modded to "Informative"? Slashdot moderators are the _pits_.
Read ingo's reply to Linus. They _did_ start
one test serially and also _parallelly_ . In short he says that its possible.
vv
Re:Not 100,000 threads in parallel, just 50. (Score:5, Informative)
See, for example, http://www.linux.cu/pipermail/linux-prog/2001-Feb
Don't forget: Just because this is
Re:Not 100,000 threads in parallel, just 50. (Score:5, Informative)
And yes, Linux's process context switches are on a par (possibly faster - can't be bothered to look up benchmarks) with NT's thread context switches.
K.
Re:Not 100,000 threads in parallel, just 50. (Score:4, Interesting)
The low latency patches go through the kernel breaking up areas where spinlocks are held for long periods of time. That's what causes massive scheduling latency in the kernel.
Context switching under Linux
Go do some real research before you accuse someone who's right of karma whoring bullshit.
himi
Re:Not 100,000 threads in parallel, just 50. (Score:4, Informative)
- The speed with which the kernel can
schedule and context-switch among threads
m =103228014211983 [theaimsgroup.com].
The O(1) scheduler patch for 2.4 seems to help
here.
- Memory usage per thread
- Concurrency limitations of the Apache code
itself
- General robustness of the thread
implementation
At first glance, it looks like the NPTL could be a win for threaded Apache on Linux, as offers some solutions first the first and last of these issues.For some recent data on this, see http://marc.theaimsgroup.com/?l=apache-httpd-dev&
This has been improving gradually with successive 2.0 releases, as the remaining global locks are removed or optimized.
The current (2.4) Linux threading implementation doesn't work well with debuggers.
Re:Not 100,000 threads in parallel, just 50. (Score:5, Informative)
Re:Help with DoS? (Score:5, Informative)
How the hell did this get +2?
a) most server software, apache 2 aside, doesn't use threads;
b) most DoS attacks are based on bandwidth saturation rather than local resource starvation. As a result, it doesn't help.
BS. This guy asks an innocent question, certainly not worth 2 antagonistic responses. Besides, Apache is a very important application, plus I know other server software that uses thread.
The DoS attacks that are based on bandwidth saturation are typically called DDoS attacks instead. I would say that most DoS attacks are in fact based on crashing the server, which is clearly not based on bandwidth saturation. Plus, there are important attacks that rely on resource saturation, such as the TCP SYN attack. Stopping DoS is not a one step process; you have to deal with it at every stage of the game.
-a
Sounds cool, but all I could think of... (Score:5, Funny)
Sorry, had to
Re:Sounds cool, but all I could think of... (Score:5, Funny)
"Hello, my name is Ingo Molnar. You kill -9 my parent process. Prepare to vi."
NOOO!!!!! (Score:3, Funny)
Re:NOOO!!!!! (Score:5, Funny)
I am further replying pre-emptively to dissuade the AC's who would otherwise reply to me and point out my egregious abuse of run-on sentences.
I am further replying pre-emptively to dissuade the AC's who would otherwise reply to me and point out my egregious abuse of +1 bonus.
I am further replying pre-emptively to dissuade the AC's who would mod this post down as off-topic because they do not get the parallel allusion to fork-bombing.
Re:NOOO!!!!! (Score:5, Funny)
Windows (Score:3, Interesting)
Re:Windows comparison (Score:4, Informative)
C//
whoa! (Score:4, Funny)
Great (Score:3, Funny)
Re:Possible use (Score:4, Insightful)
>>>>>>>>
Then please stay away from my GUI apps. I hate those UNIX grognards that come from that school of thought, then try to code GUI applications with only one thread and end up with apps that can't update the GUI while doing I/O. On my 300 MHz PII, that particular trait made Galeon unusable. It had one rendering thread for all the tabs, so when I was loading a complex page like
nice, but... (Score:4, Interesting)
Re:nice, but... (Score:4, Informative)
According to a mail from Ingo Molnar halfway down the linked article, M:N threading doesn't really solve the real problem - it's good at switching back and forth between running threads, but the real reason for having very large amounts of threads (be they kernel or user space threads) to begin with, is to do IO, and for that, there is no real advantage of user space threads.
More info on the 1:1 vs M:N issue can be read in the white paper [redhat.com]
How will this affect Mozilla, OpenOffice... (Score:4, Interesting)
While it probably is generally true that it will take some time for most applications to start using the new threading model some larger applications could support it fairly soon.
Can we expect these applications to be adapted to the new threading model some time soon, and how will it affect performance?
big deal (Score:4, Funny)
100000?! (Score:3, Redundant)
LEXX
Linus didn't think much of O1 scheduler (Score:3, Interesting)
Re:Alternative headline (Score:4, Informative)
Uh, why did that get moderated as a troll? Oh, right, Linux is absolutely perfect, and anyone who says otherwise must be a troll.
Come on, Linux's scheduler has long been known to have performance problems once you have a lot of processes/threads... for example, read this paper [linuxalpha.org] [text version [216.239.39.100]] (appropriately subtitled "How I Learned to Love the Alpha and Hate the Scheduler"):
Moderators, don't be Slashbots, moderating according to the groupthink. Educate yourselves, and you'll be better moderators, and better people.