Re: Not a performer question, but what the hey: pthreads oddity

New Message Reply Date view Thread view Subject view Author view

From: Angus Dorbie (dorbie++at++sgi.com)
Date: 03/15/2000 08:21:17


These effects can be caused by the dynamics of memory access and locks
in your program.

You need to design how your code is coing to access memory, and how you
intend it to synchronise between threads then code it to explicitly
behave like that.

CHeers,ANgus.

"Volz, Bill (WRVO)" wrote:
>
> Sorry for this not being a performer question, but I can't find an answer on
> the developer's page and can't figure out where else to post.
>
> I've got an OpenGL program that has a section that is not graphics dependant
> but is a heavy cpu burner. I've noticed from gr_osview, that without
> threads, there appears to be an idle cpu on my 2 cpu onyx2. To make use of
> the cpu, I'd like to use threads. Then no threads are in use the critical
> section runs at a rate of about 1 second/iteration. When I use one thread it
> runs at a rate of about .88 second/iteration. But when I go to two threads I
> get different behavior. Sometimes it runs in .88 seconds/iteration, other
> times in about .55 seconds/iteration. There is no change in the program, I
> just restart. When it runs in the fast way, both cpu's are busy, when in the
> slow mode only one appears to be active.
>
> Can someone explain what this means, and how I can ensure that both cpu's
> are used? I'm not using pthread_setrunon_np, due to portability concerns.
> pthread_getrunon_cp returns cpu 0 in all cases.
>
> Thanks,
>
> William R Volz - Senior Research Geophysicist
> Chevron Petroleum Technology
> Voice: 281-596-2059 Fax: 281-596-3009
>
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com

-- 
For Performer+OpenGL tutorials http://www.dorbie.com/

"In the middle of difficulty lies opportunity." --Albert Einstein


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Mar 15 2000 - 08:21:32 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.