Issue with X server lock from jogl

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Issue with X server lock from jogl

huy1912
This post was updated on .
I've encountered with locking of X server, below is the scenario

 - Java application, aka APP1, is using jogl to draw on the canvas
 - Another java application, aka APP2, is developed by third party. The APP2 is used to record the display output from the APP1. And the APP2 will be exited if no output is captured for more than 5 seconds. Because of proprietary of APP2, I don't know how the APP2 has been implemented in details.

Sometimes, when I checked the log, I found that APP2 had exited due to APP2 was unable to capture the display for more than 5 seconds. I've contacted the third party guy, he told me that the reason of APP2 not being able to capture the display due to the X server was being locked by APP1.

Has anyone known whether the X server is being locked during drawing? If it's being locked, whether it causes any side effect as described by third party guy above?

Regards,
Huy
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with X server lock from jogl

gouessej
Administrator
Hi

I'm a bit sceptical, I don't think that JOGL locks the X server permanently but I advise you to look at our source code to check that. Moreover, if you really want to know what happens, don't use proprietary softwares, it's easy for the "third party guy" to blame JOGL as we can't see his source code.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with X server lock from jogl

huy1912
This post was updated on .
Thanks Julien.
I have spent a bit more time to simulate the X Server lock, below is the sequence diagram of locking X Server, drawing on Canvas and unlocking X Server
.

Do you think that the X Server is exclusively locked during the "lock surface" phase?
The reason is the APP2 doesn't exit with above simulation of taking more than 10 seconds to draw on the Canvas.

Moreover, I'll try to learn from the third-party guy to ensure that I can understand their implementation further.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with X server lock from jogl

gouessej
Administrator
Hi

In my humble opinion, you should use NEWT at least to confirm that AWT is the culprit.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with X server lock from jogl

huy1912
NEWT is not being used in my system.
In your opinion, what is the possible cause that AWT can be the culprit?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with X server lock from jogl

gouessej
Administrator
The lock comes from the Java AWT Native Interface. Please use NEWT at least to confirm that dropping AWT solves your problem.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with X server lock from jogl

huy1912
I'll spend sometimes with NEWT.

By the way, I saw the XLockDisplay from java and navtive code, but couldn't find where it gets called.
Does this method get called by AWT native?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with X server lock from jogl

gouessej
Administrator
I don't know but you can look at the source code of OpenJDK.

You should read this report to understand how Sven drove JOGL lock free, it answers to your question:
https://jogamp.org/bugzilla/show_bug.cgi?id=616
Julien Gouesse | Personal blog | Website
Loading...