Add extra workQueue synchronisation
Posted: Mon Jan 10, 2011 4:59 pm
Bug tracker link: http://www.ogre3d.org/mantis/view.php?id=386
There are several cases where I need to make sure certain tasks have completed before I render another frame. As a result I would like to add an extra feature to the workQueue which will allow certain tasks to be added which must be completed before the next frame. The implementation of this should be fairly simple, however is this a stupid idea!!?? Should I go about this in a different way?
The way I think this should work is to have an extra, optional, parameter in "addRequest" called completeBeforeNextFrame, or something! If true its added to a different task queue. I have not decided how the logic should work on dealing out the tasks in the different queues as it will depend on the number of worker threads. The workQueue then just needs an extra method which will wait for the completeBeforeNextFrame queue to be empty (a bit more logic needed here as when queue is empty it does not mean all tasks have finished)
This may require a bit more locking but it should be minimal and not affect the performance.
Anyway I hope that makes sense, please let me know your thoughts!
There are several cases where I need to make sure certain tasks have completed before I render another frame. As a result I would like to add an extra feature to the workQueue which will allow certain tasks to be added which must be completed before the next frame. The implementation of this should be fairly simple, however is this a stupid idea!!?? Should I go about this in a different way?
The way I think this should work is to have an extra, optional, parameter in "addRequest" called completeBeforeNextFrame, or something! If true its added to a different task queue. I have not decided how the logic should work on dealing out the tasks in the different queues as it will depend on the number of worker threads. The workQueue then just needs an extra method which will wait for the completeBeforeNextFrame queue to be empty (a bit more logic needed here as when queue is empty it does not mean all tasks have finished)
This may require a bit more locking but it should be minimal and not affect the performance.
Anyway I hope that makes sense, please let me know your thoughts!