Re: [osg-users] Custom osg::NotifyHandler problems and multi-threading

2011-12-05 Thread George Bekos
Thank you very much for your reply Robert! When (and if) I find some time I will look into microsoft's stream implementation code. I have one last question though: Is the int NotifyStreamBuffer::sync(void) function in file Notify.cpp thread-safe? I am not sure how those

Re: [osg-users] Custom osg::NotifyHandler problems and multi-threading

2011-12-01 Thread George Bekos
Hello again! Thanks for your reply Robert. I want to apologise because I was wrong when I said that the problem goes away when you remove the _logmessage line. Even if I have an empty osg::NotifyHandler::notify() function, it will still crush (although it might take some time)! This is what I

Re: [osg-users] Custom osg::NotifyHandler problems and multi-threading

2011-12-01 Thread Robert Osfield
Hi George, I'm afraid I really can't help you it hunting down what the issue is as I haven't used Windows for development for over a decade. I have read that are problems with MS's stream implementation which may well be what is the root cause of the problems you are seeing. Try another

Re: [osg-users] Custom osg::NotifyHandler problems and multi-threading

2011-11-30 Thread Robert Osfield
Hi George, The effect of removing the _logmessage suggests to me that the MS implementation does something odd making it unreliable when being called from multiple threads. Try replacing the _logmessage with a fprintf or equivalent C function to see if that helps. Robert. On 29 November 2011

Re: [osg-users] Custom osg::NotifyHandler problems and multi-threading

2011-11-29 Thread Robert Osfield
Hi George, On a first read your LogFileHandler looks OK, the Mutex should in theory resolve multi-threading issues. From the details you've provide one can't pinpoint what the problem might be so you'll need to work through iteratively to see what the problem areas might me. One test I'd do is

Re: [osg-users] Custom osg::NotifyHandler problems and multi-threading

2011-11-29 Thread George Bekos
Hello Robert, Thank you very much for your reply. I did remove the _log message; line and the problem goes away. When I get the crush, in which VStudio reports heap corruption, I use the debugger to have a look at the corrupted memory block, and it always points to some region where the

[osg-users] Custom osg::NotifyHandler problems and multi-threading

2011-11-28 Thread George Bekos
Hello everyone! :] I am trying to redirect all OSG notifications to a file by creating my own notify handler class (inheriting from osg::NotifyHandler) but I get some random crushes. Mostly during run-time and sometimes when I close the application. All of them reporting some kind of heap