Packagers: Xlib vs XCB

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

 



'Twas brillig, and R?mi Denis-Courmont at 17/08/10 09:00 did gyre and
gimble:
> 
> On Mon, 16 Aug 2010 14:51:48 +0100, Colin Guthrie <gmane at colin.guthr.ie>
> wrote:
>> As some of you will have found out, there are some applications that
>> have problems relating to Xlib usage (XCloseDisplay() IIRC) when
>> combined with PA client libs (notably I've seen reports from VLC
>> relating to this).
> 
> VLC media player proper works fine with Xlib and PulseAudio (although it
> wouldn't to have a PulseAudio expert look at the PulseAudio support).
> 
> The Xlib problem can manifest itself in two different ways:
> 
> * If a process calls XInitThreads() _after_ XOpenDisplay(), then
> XCloseDisplay() will crash trying to acquire a non-existent mutex. This is
> typical if you use LibVLC but fail to call XInitThreads() early in your
> main() function.
> 
> * If a multi-thread process uses Xlib from more than one thread but never
> calls XInitThreads(), then depending on the phase of the moon, then race
> conditions might trigger crashes (typically in the form of heap corruption
> in my experience) depending on the phase of the moon.
> 
> As regards PulseAudio, the issue comes up if libpulse is used from a
> different thread than Xlib. Calling XInitThreads() from main is the
> "official" solution. Unfortunately, there are many scenarii where this does
> not work. You might not have control over the main() function (e.g. the VLC
> plugin for Mozilla). Also Xlib might be hidden deep beneath frameworks that
> do not call XInitThreads, such as GTK or Qt.
> 
> Since libpulse does not really need any Xlib feature not found in XCB, I
> humbly think switching to XCB is the best choice. XCB is thread-safe by
> default. Thank you for that.

Thanks R?mi for the detailed description :)

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]




[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux