Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
pthreads
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Sparc
View previous topic :: View next topic  
Author Message
ibtim13
Tux's lil' helper
Tux's lil' helper


Joined: 12 Sep 2003
Posts: 84
Location: Troy, NY

PostPosted: Wed Mar 09, 2005 3:08 am    Post subject: pthreads Reply with quote

Are pthreads broken on gentoo sparc?

I recently wrote a simple program that makes extensive use of pthreads.
When testing it on my Ultra 2 it ran, but it ran painfully slow, and it should not have.

On another machine that I have (500Mhz AMD K6-2, 256MB ram) running gentoo, linux 2.6.10-r6, gcc 3.3.5.
The program completes in about 1.5minutes.

On my Ultra 2 (2x400Mhz UltraSparc II, 1GB ram) with all the same software, kernel, compiler.
The program completes in about 25minutes. That is 25, not 2.5.

The program makes extensive use of pthreads, and so it should take advantage of the 2nd processor on the Ultra 2
and run faster (not almost 20X slower!) than on the K6-2.

A 100Mhz advantage should not overcome a full extra processor and 4X as much ram, especially in a multithreaded program.

The program does function correctly in both situations, I just cannot believe that it would be that much slower on sparc.
Also, the Ultra2 is otherwise completely stable, and responsive.
In fact, I rewrote my program to fork new processes (just, to confirm if it was the threading giving me a problem) and
the new program completed in ~45 seconds on my Ultra2.

So, does anyone know if there's something wrong with pthreads in gentoo sparc?
I didn't see any Bug reports, and I'm not sure what I would put in one other than
when I use pthreads it goes very slow.
(On a possibly related note, the recent kde kicker crashing problem reports a pthread error as well)
_________________
Grrr, can't think of anything clever right now, I'll go back and edit this later (9/12/2003)
Back to top
View user's profile Send private message
ibtim13
Tux's lil' helper
Tux's lil' helper


Joined: 12 Sep 2003
Posts: 84
Location: Troy, NY

PostPosted: Wed Mar 09, 2005 5:14 am    Post subject: Reply with quote

just a small addition. It works just fine in Solaris 9 with gcc 2.95 on the same hardware.
(the only problem there is solaris 9 has (nasty nasty) user threads so SMP doesn't get used like it does in linux)
_________________
Grrr, can't think of anything clever right now, I'll go back and edit this later (9/12/2003)
Back to top
View user's profile Send private message
squash
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jun 2002
Posts: 79

PostPosted: Thu Mar 17, 2005 7:30 pm    Post subject: Reply with quote

Hello,

pthreads on linux, without NPTL, are also user-space threads. With that said, you would have to post the code in question to see where the issue is. Try running through strace even.

Josh
Back to top
View user's profile Send private message
ibtim13
Tux's lil' helper
Tux's lil' helper


Joined: 12 Sep 2003
Posts: 84
Location: Troy, NY

PostPosted: Sat Mar 19, 2005 2:50 am    Post subject: Reply with quote

Interesting. From everything I've read about linux threads so far I got the impression that
pthreads in linux have either always been kernel threads or at least were kernel threads
well before NPTL. I thought NPTL was just a newer more efficient implementation that gave
far better performance.
_________________
Grrr, can't think of anything clever right now, I'll go back and edit this later (9/12/2003)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Sparc All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum