Debug Scope when on other thread
Caspole, Eric
Eric.Caspole at amd.com
Tue Feb 18 08:53:48 PST 2014
Hi everybody,
We have 2 sample apps that use our Stream API forEach() based offload. In one sample, the Graal compiler runs on the main thread when invoked by the app. In the other sample, Graal runs on the AWT-EventQueue-0 due to the design of the sample's screen drawing code.
In this second app, Graal debug flags like -G:Log=CodeGen do not work. It looks like the debug flag state is stored in thread locals, but the the initialization for that is only done once for the main thread, called from VMToCompilerImpl.startCompiler(). Later when we use Graal from the AWT thread, its debug flag state config is null. Otherwise everything seems to be working fine.
I made a very simple webrev to work around this problem, but I don't think it is the 'real' fix -
http://cr.openjdk.java.net/~ecaspole/other_thd_debuginfo/webrev/
Generally, does an app using Graal need to do some more initialization that we are not doing yet when on another thread besides the main thread, or can this be automagically done under the covers in Graal? What is the right way to fix this specific problem?
Thanks,
Eric
More information about the graal-dev
mailing list