Hi Marcus,
The exeption is a exeption (first Chance) at ... in main.exe: 0xC0000005:
access violation at Position 0x00000000.
I have changed the code a bit and it crashes deep inside OSGSystemD.dll, and
I am having no clue.
I guess I am doing wrong something very basic, so I would like to follow
your guesses:
How can I "make sure the myTransform ptr is correct"?
How do I set an OpenSG aspect and initialize it for the current thread, as
you said?
My first approach was to simply use qt's qtconcurrent framework to go
multithreading. I understand that I have to use native threads with opensg?
Thank you in Advance,
Georg.
Georg Wünsch wrote:
> Dear opensg users,
>
> I am having an opensg 1.8 setup where a scenegraph is being drawn by the
gui
> thread and another thread is manipulating the graph in the mean time. As I
> understand opensg architecture, this is one of the applications open sg is
> designed to work with.
>
> I am encountering the following problem:
>
> In a special object I am storing refptrs to transform cores in the scene
> graph. I would like to manipulate the matrices of the transform cores
> directly by another thread.
>
> Now a exeption is occurring whenever I am setting up an osg::Matrix with
my
> own values and try to assign them to the stored transform core:
What kind of exception?
> Class myclass
> {
> float x11, ..., x44;
> TransformRefPtr myTransform;
> ...
>
>
> __forceinline void manipulateTransform()
> {
> osg::Matrix newMatrix(x11, ..., x44); <<-- throws an exeption(!!!)
> beginEditCP(myTransform);
> myTransform->setMatrix(newMatrix);
> endEditCP(myTransform);
> };
> };
>
> For some reason the error seems to occur one or two lines before the
> beginEditCP() call. (Btw We are doing a lot of __forceinline AND in the
> single threaded version it is working very well). What might I be doing
> wrong?
Is the this-ptr correct when that function is called? Is the object
being destroyed in an other thread due to a race condition? Such things
might make reads of x11->x44 produce an access violation failure, etc.
The OSG::Matrix constructor is dumb enough so that shouldn't really be
an issue. See if it happens by just adding x11 and x44 and storing it in
x33. :)
Also, make sure the myTransform ptr is correct _and_ that there's an
OpenSG aspect set and initialized for the current thread (but that
should be ok, as you're already using threads.)
Cheers,
/Marcus
----------------------------------------------------------------------------
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus
on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users