Carsten Neumann wrote:
>       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.

Good. This is the best I was hoping for. :)

I think I can manage this. My processing will be done prior to any 
rendering calls so I should get away with it. I will consult the 
changed() implementation of the FCs if I happen to run into trouble.

>> 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 ?

Missing objects/geometry/textures. Crashes in my code due to the same 
(null GeoProps/StateChunks) and some problems with ShaderParameterChunk 
(which I have patched locally after advice from this mail-list.)

I can't give specifics because I tried to apply this to our entire app, 
and it's quite big, and things went wrong everywhere. I need to dumb the 
application down to a single viewport and a teapot, and work from there. :)

Cheers,
/Marcus


-------------------------------------------------------------------------
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

Reply via email to