octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #40343] Suggestion: Add XInitThreads() call be


From: anonymous
Subject: [Octave-bug-tracker] [bug #40343] Suggestion: Add XInitThreads() call before starting the QT based GUI.
Date: Tue, 22 Oct 2013 03:17:47 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0

URL:
  <http://savannah.gnu.org/bugs/?40343>

                 Summary: Suggestion: Add XInitThreads() call before starting
the QT based GUI.
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Tue 22 Oct 2013 03:17:46 AM UTC
                Category: GUI
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Other
                  Status: None
             Assigned to: None
         Originator Name: Mario Kleiner
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

This is a mixture of proposal and request. It would be a good idea to add a
call to XInitThreads() in octave's GUI startup function before the QT based
GUI or other XLib based functionality is initialized.

XInitThreads() switches XLib into thread-safe mode, using proper internal
locking, so that XLib functions can be called concurrently from different
threads without mysterious crashes or hangs. This would be beneficial for 3rd
party toolboxes/code, which might use XLib internally inside mex/oct files. It
could also help avoiding some multi-threading bugs iff the QT based GUI does
XLib calls to update widgets from different threads - i didn't check if it
actually does that.

In the past, my own open-source toolkit Psychtoolbox called XInitThreads()
internally when its mex files got loaded into octave, because it performs XLib
calls from different threads, but with octave's GUI this is no longer an
option, because XInitThreads() must be called before any other XLib function
in a process, and as octave's GUI uses QT and QT will call XLib functions
during GUI startup, my mex files will be too late to the party if they try to
call XInitThreads() after the octave session is already running.

I resolved this problem by introducing my own locking around XLib calls, but
other 3rd party octave extensions might run into similar problems or
regressions on Octave 3.7+ with GUI enabled.

thanks,
-mario





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?40343>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]