I've been running OSG1.0 on dual-core HT Pentium D Windows XP machine,
without that problem.  (looks like 4 procs).  Although, it looks like I
updated to OpenThreads 1.1 (OSG_OP_OT1.1 version of OpenThreads) to fix some
lock up problems.  Maybe at the time I was experiencing the same problem?
It is too long ago for me to remember, though, and my CM logs don't tell me
the reason.  Is it possible you are not compiling the correct OpenThreads
version?
 

Zach


 

  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Glenn Waldron
Sent: Wednesday, March 07, 2007 14:56
To: osg users
Subject: Re: [osg-users] Problems using QueryPerformanceCounter()??


Anders,
There is a previous discussion on this topic here:
http://openscenegraph.org/archiver/osg-users/2006-March/0252.html

I'm running OSG 1.2 and I still see this problem on dual-core or HT
machines. -gw


On 3/7/07, Anders Backman <[EMAIL PROTECTED] > wrote: 

Is there anyone out there experiencing strange hang and timing problems on
dual CPU/Core/HT windows XP machines? 
except for the ordinary laptop-timing problems of course ;-)


Im currently debugging something that gives me gray hair, and someone
suggested that it could be a potential problem coming from the fact that
QueryPerformanceCounter() is used (osg::Timer) 
I have an app that runs just fine for a while (can be 1 minute, sometimes
30) and then it hangs, and it never occurs in debug-mode (of course!) so its
quite tricky find the cause for it.
I have already found one reason for the hangs, and that was in Producer
where a OpenGL timer query never returned....But that is fixed (by skipping
after 1000 iterations). 


It seems to be quite a few developers with this problem when I searched the
web.

For example:
http://www.virtualdub.org/blog/pivot/entry.php?id=106
<http://www.virtualdub.org/blog/pivot/entry.php?id=106> 

It seems that when a thread is moved in and out between different execution
cores/CPU:s it can drop timing or even get negative timing results....
It also talks about hangs (which I guess could be a second order problem
that comes from the timing problem). 
Right now Im looking at something that looks like a hang inside
osg::Timer::tick()


So is there anyone else experiencing this?


There is a bunch of recommendations from MS:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/
Game_Timing_and_Multicore_Processors.asp

- using QueryPerformanceCounter from only one thread
- setting SetThreadAffinityMask so that the timing thread runs on only one
CPU/Core
- clamping the subtraction result so you never get a negative one:

        inline double delta_s( Timer_t t1, Timer_t t2 ) const { return
(double)(t2 - t1)*_secsPerTick; } 

Should be:

        inline double delta_s( Timer_t t1, Timer_t t2 ) const { return
(double)osg::clampAbove((t2 - t1), 0)*_secsPerTick; }






-- 


________________________________________________________________ 
Anders Backman               Email:    [EMAIL PROTECTED]
HPC2N/VRlab                  Phone:    +46 (0)90-786 9936 
Umea university              Cellular: +46 (0)70-392 64 67 
S-901 87 UMEA SWEDEN         Fax:      +46 90-786 6126
                               http://www.cs.umu.se/~andersb
<http://www.cs.umu.se/%7Eandersb> 
_______________________________________________
osg-users mailing list
[email protected] 
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/




-- 
Glenn Waldron : Pelican Mapping : 703-652-4791 
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to