Hi robert,
2007/2/1, Robert Osfield <[EMAIL PROTECTED]>:
Hi Adrain, On 2/1/07, Adrian Egli <[EMAIL PROTECTED]> wrote: > very interesting talk. i developped once a system to syn threads, and > rendering in parallel for multi windows. it has to work also in single > thread, if we have a single core cpu, it isn't faster doing things multithreaded as > you know. Well there are cases when multi-threaded on a single core can be faster than single-threaded, particularly when IO is involved. I haven't done with the new threading model on a single core single screen system yet.
ok, may we can test it once. but in fact normaly we don't have many IO operations doing visualisation. (just database pager)
it was easy to add an user thread, without thinking about the syn. etc. so What do you mean by syn. etc?
may core application hat a master thread. and n-user threads, the master thread has to manager the syn, priority, (thread management) then we just add an object with two methods, a async and a sync methode, in the master thread we call each sync methode after each other, then the manager decide wether he will invoke for one frame, a thread to run into async methode, only shared memory read allowed, then if all have finished, back to update pass (sync) and so one. for user application we can just add an object implementing the interface with the two methode, sync and async. acces to the scenegraph only const. for simulation work, wether we have to update and recalc for each frame with a time step, and so on, it is very easy to do it. also database pager would be a possible threaded object, can be make us of this. when the master thread aks for sync, the database pager object could update the scenegraph in safty way. of cours the i/o should be done async. there will be two possible threaded object, one witch only has to know wether we pass into a sync (update) pass or we still are in async doing sync visualistion of many windows, openGL context. and also object were are not really sync, ask for time in the update pass (database pager, when he has a sub scene to pagein or out) event triggered. but managed by the master thread.
may question would be how do you implement it, and would it be possible to > run also in n-thread model, can i add my own thread (simulation, so on) > without thining about openscenegraph threading, crash, race condition, so on Added extra threads to do other operations is possible, how easy depends on the nature of the operations that you are conducting. One thing I have considered is adding support for running the read only camera threads alongside configurable end user read only operations. These operations would need to complete within a frame though, otherwise they'd stall the main loop - as you can't advance a frame till you've finished doing all read only ops. Although I must add I'm bending this rule a bit in new thread per camera model, as the graphics thread can continue running even after the read-only section has completed, with the proviso that the bits its left reading from are static objects not changed during the update phase of the scene graph. Was it read only threaded operation what you were thinking of? BTW, one could make non read only op, read only by caching the modifications so that they are applied during the update phase. Is this the type of thing you were wondering about? 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/
