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!
Add extra workQueue synchronisation
-
- OGRE Expert User
- Posts: 1227
- Joined: Thu Dec 11, 2008 7:56 pm
- Location: Bristol, UK
- x 157
-
- OGRE Retired Team Member
- Posts: 2903
- Joined: Thu Jan 18, 2007 2:48 pm
- x 58
Re: Add extra workQueue synchronisation
I'm not sure there's additional logic required.
You could use a ResponseHandler to know when your job finished. You could then, in your render loop, wait for a condition set by this Handler; that's what would need to be done either way.
You could use a ResponseHandler to know when your job finished. You could then, in your render loop, wait for a condition set by this Handler; that's what would need to be done either way.
-
- OGRE Expert User
- Posts: 1227
- Joined: Thu Dec 11, 2008 7:56 pm
- Location: Bristol, UK
- x 157
Re: Add extra workQueue synchronisation
I could use a ResponseHandler to do this, infact that is how I am doing it now, sort of! However it seems like a feature that would be needed by most engines which is why I am suggesting a more central approach in the work queue.
-
- OGRE Expert User
- Posts: 1227
- Joined: Thu Dec 11, 2008 7:56 pm
- Location: Bristol, UK
- x 157
Re: Add extra workQueue synchronisation
Would anyone been interested in a patch that did this!? Ogre Mods?