Mario,

On Friday 27 June 2008 16:09, Mario Valle wrote:
> > Ok, I see. You are running in gcc, i386 without any -march= compiler
> > flag. So gcc assumes that you want to compile for a plain old i386 (read
> > this does not even mean an i486). In this case gcc is limited to an
> > instruction set where no such atomic operations are available. In fact
> > you could not even programm a mutex with that i386 instruction set, as
> > well as you could not build any SMP machine using an i386.
>
> Ahi Ahi Ahi!!
>
> That means that I'm working without this optimization since the beginning?
> And nevertheless OSG is so fast?
>
> I specify in the advanced cmake options:
> CMAKE_C_FLAGS                    -march=i486 -mtune=i486
> CMAKE_CXX_FLAGS                  -march=i486 -mtune=i486
> Then configure and generate, but the ./include/OpenThreads/Config file
> continues with everything commented out. Have I missed something?
Ok, then throw away your build to make sure that nothing si left.

I am not sure how many things are cached in what part of the cmake build 
system. I just want to be sure ...

Then set again the cflags. And better set them to something 
like -march=pentiumpro. Also do not forget to include -O or -O3 or something 
like that. Without you do not get any optimizations I guess ...

Then ensure that cmake does not see previous caches ...

BTW: does anybody know a way to tell cmake that a variable should not be 
cached?

> > In this case, when we cannot assume any atomic operations. So we need to
> > use the previous mutex based behaviour.
> > But for that, the old mechnisms are still there. You need to ensure that
> > refcounting works in a threadsafe way using either the
> > OSG_THREAD_SAFE_REF_UNREF environment variable or by calling
>
> OK, thanks. But for now I want only to contribute with my ignorance :-) to
> polish this OSG functionality.
>
> > osg::Referenced::setThreadSafeReferenceCounting(true);
> >
> > before *any* concurrently used osg::Referenced object is created.
> > Alternatively you can uncomment that ENFORCE_THREADSAFE define in
> > src/osg/Referenced.cpp that does change the default behaviour of
> > referenced.
> >
> >> As soon as the build finishes, I will report back to you.
>
> OK, now crashes in another place, see below. This run has been done before
> changing march/mtune.
>
> > Are you running with the environment variable OSG_THREAD_SAFE_REF_UNREF
> > set or unset?
>
> Unset
Can you test with this variable set?

I believe that these thread safety defaults in osg are not good in face of 
that multithreaded viewer stuff, but I just left them as is.

Robert,
Should we include that ENFORCE_THREADSAFE define in the cmake configuration? 
And in face of all this threading usage in osg, should the default change to 
on?

And, yes, I should write a wiki page. I hope to find some time today ...

Greetings

Mathias

-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Florian Geyer,
Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Prof. Dr. Hanns Ruder
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to