JOGL_SINGLE_THREADED_WORKAROUND issue

I have a program that NEEDS to be very compatible, and I can’t go telling users to add the command line" -DJOGL_SINGLE_THREADED_WORKAROUND=true" because that just isn’t professional. I’ve tried the code,

            System.setProperty("JOGL_SINGLE_THREADED_WORKAROUND", "true");

as the first line in main, but that doesn’t seem to actually set it.

After a little more research I’ve found that using System.setProperty works with java.exe, but not with javaw.exe. Any ideas? The jarfile is launched by double-clicking, which invokes javaw, which for some reason won’t allow the single thread property to work.

I would be very surprised if System.setProperty() didn’t work with javaw.exe. How are you determining whether the setting of the system property has succeeded?

Actually I was determining if it worked or not by whether or not it was crashing. And for some reason it crashed more with javaw.exe than with java.exe but both are using the workaround (I’ve tested with jogl.verbose) but it still crashes fairly consistantly on ATI cards. This is a very thread intensive program (and actually my first experience with threads, so I wouldn’t be surprised if I did something wrong) But it works on any computer except for those with ATI cards, is there any possible way that the ATI thread does something to starve mine?

There is no ATI thread. The single-threaded workaround pushes all OpenGL work which is performed inside your GLEventListener over to the AWT event queue thread. The first thing you should do is make sure you aren’t trying to call OpenGL from outside the context of your GLEventListener (meaning that the OpenGL context isn’t current). You should be able to use the DebugGL for this purpose.

If you are getting an actual crash, you should be able to look at the error log produced by HotSpot and see exactly what caused the crash, and then figure out whether you’re trying to call OpenGL on the wrong thread or something similar.

I figured it out. jconsole (a wonderful tool by the way) helped my watch my threads and see that I did actually have a rare deadlock condition which depended on the speed of the system (It only occured on faster systems)…but thanks for your help.