On 7/7/06, Thibault Genessay <[EMAIL PROTECTED]> wrote:
void SwitchToThread(void) (NT/2000/XP/2K3) does the job. (On W2k3
platforms, there exist the YieldProcessor macro but I don't know
exactly what it does ...)
Re-examining the the code in OpenThreads, it uses SwitchToThread but
fallsback to Sleep(10) for older versions :
#if _WIN32_WINNT < 0x0400 // simulate
int SwitchToThread (void)
{
::Sleep(10);
return 0;
};
#endif
int Thread::YieldCurrentThread()
{
return SwitchToThread();
}
Adrian, maybe you can modify OpenThreads, replacing Sleep(10) by
SwitchToThread() and see if it improves your performance.
That depends on what OS Adrian is using...
> There are pthread implementations under Windows, perhaps you could use this.
Won't those be based on Win32 API, thus adding an extra layer between
OpenThreads and Windows ?
Yes I believe this will be the case. That being said some users
originally found the pthreads path more stable under Windows than the
direct Win32 path.... not sure what pthreads was adding extra in turns
of protection.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/