login
Header Space

 
 

Re: revivesa status 2008/07/09

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Mindaugas Rasiukevicius <rmind@...>
Cc: Christos Zoulas <christos@...>, <tech-kern@...>
Date: Thursday, July 24, 2008 - 4:25 am

On Sat, Jul 12, 2008 at 07:05:43PM +0100, Mindaugas Rasiukevicius wrote:


As far as I can tell, this is the fictional application that M:N is targeted
at: tens of thousands of threads running in userspace, doing nothing but
synchronizing among themselves. In other words, an app that does nothing. 10
years ago that might have seemed new and cool, even necessary, but people
have begun to get to grips with multithreaded programming and it's now
obvious that thread synchronization is to be avoided at all costs.

Even that fictional app will break down with more than one CPU, unless you
are willing to replicate the entire multiprocessor aspect of the scheduler
in userspace. If you do that, the thread library's scheduler then needs to
talk to the kernel scheduler to effectively schedule threads on other CPUs.
Not only are you now doing twice the work, you're calling into the kernel to
get things done. The dog begins to chase its tail.

Note that, if your application blocks in kernel while doing I/O (reasonable
applications talk to the outside world) SA adds a lot of overhead. I suspect
this is one reason why for years Sun advised the use of bound threads with
their M:N library. Maybe they had other reasons.


It's worth pointing out that in comparison to the SA libpthread, context
switches occur much less frequently with the 1:1 library.

Andrew
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: revivesa status 2008/07/09, Christos Zoulas, (Sat Jul 12, 12:23 pm)
Re: revivesa status 2008/07/09, Greg Troxel, (Sun Jul 13, 8:44 am)
Re: revivesa status 2008/07/09, Mindaugas Rasiukevicius, (Sun Jul 13, 9:58 am)
Re: revivesa status 2008/07/09, Bill Stouder-Studenmund, (Sun Jul 13, 6:22 pm)
re: revivesa status 2008/07/09 , matthew green, (Sun Jul 13, 8:34 pm)
Re: revivesa status 2008/07/09 , Jason Thorpe, (Wed Jul 23, 10:21 am)
Re: revivesa status 2008/07/09, David Holland, (Sun Jul 13, 10:16 am)
Re: revivesa status 2008/07/09, Matthias Scheler, (Sun Jul 13, 10:14 am)
Re: revivesa status 2008/07/09, Steven M. Bellovin, (Sun Jul 13, 9:06 am)
Re: revivesa status 2008/07/09, Mindaugas Rasiukevicius, (Sat Jul 12, 2:05 pm)
Re: revivesa status 2008/07/09, Andrew Doran, (Thu Jul 24, 4:25 am)
Re: revivesa status 2008/07/09, SODA Noriyuki, (Thu Jul 24, 8:51 am)
Re: revivesa status 2008/07/09, David Holland, (Sat Jul 12, 3:27 pm)
Re: revivesa status 2008/07/09, Jason Thorpe, (Wed Jul 23, 6:52 pm)
Re: revivesa status 2008/07/09, David Holland, (Wed Jul 23, 10:18 pm)
Re: revivesa status 2008/07/09, Jason Thorpe, (Thu Jul 24, 12:34 pm)
Re: revivesa status 2008/07/09, Johnny Billquist, (Thu Jul 24, 1:06 pm)
Re: revivesa status 2008/07/09, SODA Noriyuki, (Wed Jul 23, 10:44 pm)
Re: revivesa status 2008/07/09, Ted Lemon, (Thu Jul 24, 12:15 am)
Re: revivesa status 2008/07/09, Jason Thorpe, (Thu Jul 24, 12:37 pm)
Re: revivesa status 2008/07/09, Ted Lemon, (Thu Jul 24, 4:20 pm)
speck-geostationary