Hi Marcus,
On Mon, 2007-09-03 at 18:26 +0200, Marcus Lindblom wrote:
> Hi,
>
> I want to implement some image processing in a second thread (now that
> Carsten has fixed the TextureChunk update, thanks!), but I would like to
> do that and at the same time avoid the use of separate aspects.
>
> Can I do this reliably if I can assure that I don't mutate any common
> objects across threads? Does this also hold for fields on a single object?
in general it is possible to have two threads working on the same
aspect, as long as they do not modify the same objects. One caveat are
the side effects of endEditCP (actually the changed method of
FieldContainers, which is called by endEditCP), mainly the bounding
volume invalidation, as this modifies a lot of objects.
For your case there is another problem, which was actually introduced by
the automatic TextureChunk update: Modifying an image that is part of a
TextureChunk will concurrently access the OpenGL handling of Window.
So in general it is possible to modify the same aspect from different
threads, if you are careful of what you are doing, but in your specific
case it will likely cause problems.
> I couldn't find a summary of threading issues in OpenSG 1.8, is there
> one available? (the tutorial is not a hard spec).
:)
> Also, what will change for 2.0?
I think the above is also true for 2.0.
> P.S.
>
> Using two aspects has been difficult for me. I haven't figured out how
> to initialize the second aspect with data from the first, which I must
> do before reliably modifying anything in the second aspect. It has
> probably to do with a lot of missing CPEdit calls.
Missing begin/endEditCP calls will cause trouble in this case, otherwise
it should be straightforward to apply the changelists associated with
one aspect to another aspect. Do you have more specific information on
what problems you encounter ?
Hope it helps,
Carsten
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users