hey all-
I’ve been on wild goose chase for weeks on this nasty little threading bug. Here’s my scenario - our program opens a copy of my renderer (which is in and of itself working fabulously). Then the user does whatever for a minute… and then when the hardware has finished a second data-gathering pass at higher detail, the program closes the first instance of the renderer, and opens a new one in its place. Somehow in that process, we end up deadlocking our event thread. At first i was trying to analytically hunt down the bug. I then left work for a week or so and came back to find my code smothered with so many failed attempts to fix the problem that i’m getting lost in it. So time for a new approach!
Hopefully it’s a reasonable question to ask, what methods are there that are sensitive to threading. Is my problem likely linked to display()? Or is there another critical point I should be checking? Wherever possible, I call repaint() to update my rendering surfaces, but in a few places, it is critical that I use display(), as follows:
for(each chunk of data i need to update){
setupAllTheVariousParameters();
pBuffer.display(); // I can't wait on an event queue here; parameters might change before it got processed
}
At this point it seems more productive to me to try and find out what methods are capable of causing this sort of threading issue, and search for them, rather than analyzing my renderer’s control flow top-down. The problem only seems to arise when I have one dialog with rendered stuff already open and try to dispose() it and immediately create a new one.