-don
On 8/10/06, Robert Osfield <[EMAIL PROTECTED]> wrote:
Hi All,
Today I've been battling against a silly API inconsistency across
Linux versions/distributions, namely on some (mostly older with back
dated API) use a two parameters version of sched_setaffinity, which
others (mostly 2.6 kernel) use a three parameter version of
sched_setaffinity.
The frustrating thing is that sched.h which contains these files is
pretty well identical save for these parameter difference, there isn't
any #define's that I can use to arbitrate between the different
versions. Yuck.
This has left me with having to do the arbitration mannually, using a
#if defined(COMPILE_USING_TWO_PARAM_sched_setaffinity) in the
OpenThreads source code, and a check against the var
COMPILE_USING_TWO_PARAM_sched_setaffinity in the makefile.
Originally the set affinity code was in OsgCameraGroup.cpp, I've now
moved it into its rightful place in OpenThreads, so osgProducer now no
longer has the above problems, instead I've pushed them off to
OpenThreads. You next cvs update of OpenThreads and OpenSceneGraph
will get these changes.
To compile OpenThreads under Linux on most up to date systems things
should just compile straight without problem. So make will just work
on its own.
For systems that have the old two param version of sched_setaffinity
you will now get a compile error and will need to do:
make COMPILE_USING_TWO_PARAM_sched_setaffinity=yes
Or
export COMPILE_USING_TWO_PARAM_sched_setaffinity=yes
make
To get things to compile.
Not perfect, but hopefully a slightly better solution that having it
not compile at all.
I would very much appreciate testing of OpenThreads in light of these
new changes. Testing will need to be done on all platforms, even non
Linux ones as I've add a OpenThreads::GetNumProcessors() function too.
Thanks in advance,
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
