Hi Pjotr,
Rather than go adding extra complexity elsewhere in the OSG to handle the
use of join() I have reinstated the original OperationThread::cancel()
implementation, but retained the join(), placing it after the old
while(isRunning()) {} loop. Having the join() there appeases valgrind and
so haven't seen any issues with it's presence.
Could you do an svn update and let me know how you get on.
I am about to look at the threading issues associated with reusing objects
from the cache. If you still have it could you send me your modifications
so I can adopt this or just use it for comparison/inspiration.
Thanks,
Robert.
On 5 November 2014 13:01, Pjotr Svetachov <[email protected]> wrote:
> I first got the deadlock on linux and only in release builds. On windows I
> was able to reproduce it by placing a 1ms sleep line 403. Adding cancel
> helps but then the thread will not do any clean up and valgrind spits out a
> 1mb log file complaining about memory leaks. It's better to try to fix the
> deadlock than doing a cancel.
>
> For scenario one it should be possible to rearrange the code a little to
> make it work.
> For scenario two, a Operation should have a method that will invalidate it
> so it won't block any more. I have searched the code and have found 3 kinds
> of Operations:
> - BlockOperation: this one is invalidated by calling release, but can
> become blocking again is you call reset() or set(false).
> - BarrierOperation: this is where the deadlock occurs. But Barriers can be
> invalidated by calling invalidate() but there is currently no way to make
> them blocking again if you want to reuse them later.
> - GraphicsOperation: the release method of this one is empty already, it
> is stopped by calling setDone() when stopThreading is called.
>
> Cheers,
> Pjotr
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=61521#61521
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org