[M3devel] userthreads vs. pthreads performance?

Tony Hosking hosking at cs.purdue.edu
Sun Mar 28 18:55:36 CEST 2010


Yes, we need to implement thin locks and biased locks.  These have minimal overhead for locks held mostly by just one thread.

Antony Hosking | Associate Professor | Computer Science | Purdue University
305 N. University Street | West Lafayette | IN 47907 | USA
Office +1 765 494 6001 | Mobile +1 765 427 5484




On 28 Mar 2010, at 12:24, Mika Nystrom wrote:

> 
> In my tests, programs that acquire a lot of locks (even uncontended ones,
> I think) run much much faster with user threads than with kernel threads.
> Or at least they run much (several times) faster compiled with an ancient
> PM3 than with a recent CM3, and I'm pretty sure the threading is the
> main difference.  (Given that the effect only occurs for programs that
> acquire a lot of locks.)
> 
>    Mika
> 
> =?UTF-8?Q?Dragi=C5=A1a_Duri=C4=87?= writes:
>> CVSup w/ user threads is not faster because user threads are faster - it
>> is faster because it's buggy behaviour manifests only with kernel
>> threads. IMO.
>> 
>> Algorithm-wise - at least on Linux NPTL is O(1) decision making time, ie
>> switching threads. User threads are lots of linear list walking. Figure
>> how efficient it is. Process management "science" has gone long way
>> since "founding fathers" did user threads thingy.
>> 
>> d
>> 
>> On Sun, 2010-03-28 at 09:58 +0000, Jay K wrote:
>>> I understand that userthreads don't scale across multiple processors.
>>> But testing out cvsup lately, things are noticably much much faster
>>> with user threads. At least cvsup. I haven't watched the compiler and
>>> such.
>>> 
>>> 
>>> - Jay
>>> 
>>> 
>>> 
>>> 
>>> 
>> -- 
>> Dragiša Durić <dragisha at m3w.org>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20100328/b977c846/attachment-0002.html>


More information about the M3devel mailing list