Login  Register

Re: Turning off XInitThreads

Posted by Sven Gothel on Sep 17, 2012; 8:41am
URL: https://forum.jogamp.org/Turning-off-XInitThreads-tp4026119p4026195.html

On 09/17/2012 09:51 AM, Sven Gothel wrote:

> On 09/12/2012 05:06 PM, Andy Skinner [via jogamp] wrote:
>> I can't find documentation that second XInitThreads calls are NOP.  Could you
>> point me to that?
>>
>
> Re-evaluating whether we still need X11 display locking.
> There is a good chance this is not true, due to our impl. level locking.
> Will update you here .. or better in a bug report you may enter in our
> bugzilla DB. Thank you.
> I will push this change to a specific branch - hope you participate in testing.
>
Well, a quick review showed that it is not possible to easily
drop the multithreading requirements of XLib, b/c:
  - We reuse display connections in NEWT which
    maybe used from multiple threads. X11 locking is quite fast here,
    since usually xcb is being utilized as the backend.
    Simply removing XInitThreads()
    (even though no explicit XLockDisplay/.. is in place) will cause havoc.
    xcb_ actually detects concurrent access and aborts JOGL in this case.

  - A 'workaround' would be to instantiate one display connection per surface,
    similar as we use it currently for offscreen surfaces.

  - ...

Added experimental branch 'x11_no_xinitthreads'
for further discussions ..

<http://jogamp.org/git/?p=jogl.git;a=shortlog;h=refs/heads/x11_no_xinitthreads>


> Also you are right, the X11 spec doesn't even mention the case of subsequent
> XInitThreads calls - and hence YMMV.
>
> ~Sven
>



signature.asc (907 bytes) Download Attachment