----- Original Message ----- From: "Mathias Fröhlich" <[EMAIL PROTECTED]> To: "OpenSceneGraph Submissions" <[email protected]> Sent: Tuesday, September 23, 2008 6:02 AM Subject: Re: [osg-submissions] Platformindependentmatrixmultiplicationoptimization
" > how these work I may want to get together with the author of the atomic > code in OpenThreads. Good to see that a generic optimization is sufficient. That is me with the atiomics. What do you want to do? " I have had an opportunity to work with a case where I need a many-to-one relationship. So for example lets say there are several threads working in tandem, and they simply make a function/method call, and at any given timeslice a single thread will process all the calls that happened in its own thread. There is a win32 way to handle this without the need of any critical sections, mutex, semaphore, setevent, etc... This would be done VIA passing function pointers (i.e. these could be cpp methods too) in the APC queue. What then happens is during the context switch the OS processes all method calls passed in (this can work with parameters too) and calls the methods in the same single thread. This works best for cases where there is work to be done from a single point. Ideally the client code would be easier to write, and with all atomic operations make the synchronization more efficient than using other synchronization techniques. The downside of course is trying to have some generic form of this technique for other platforms, but there may be a possibility of this happening. So this is the idea. The thing which I am not sure about is if this could be useful when culling works together with opengl (or other similar serialization processes). I also do not know if the gain would be significant for these cases. One thing is for certain... the absence of critical sections is good in that it decreases the chance for deadlocks. The client code would have a method to handle outside thread calls. This method simply invokes some ThreadCall(bool wait_for_return,thread,instance,func ptr, ... parms) and then the actual method would auto-magically be called on the thread (whatever parameter which was passed in as thread) timeslice interval . If this sounds like a cool technique to pursue then I could see what I can do to provide more info. _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
