thread safety

Jamey Sharp jamey at minilop.net
Thu Jan 19 10:07:23 EET 2006


On Wed, Jan 18, 2006 at 05:00:32PM -0800, Matt Henning wrote:
> Is there an issue with particular X features and
> XInitThreads()?

I can't address your particular question, unless you've found a function
that calls SyncHandle *before* UnlockDisplay, which would be wrong.

I can tell you this though: I haven't yet been able to prove Xlib's
thread support is actually wrong (I suspect XListFontsWithInfo is
broken, but fortunately nobody actually calls that) but proving that
it's right is a nearly impossible task. My last Usenix paper has a
section dedicated to the ways that Xlib's thread support is awful: see
"How Xlib is Implemented (And What We're Doing About It)", which you can
find from http://xcb.freedesktop.org.

In short, if you want to do multi-threaded X programming (which I think
is a good idea) I'd recommend ignoring Xlib entirely and using XCB. ;-)

--Jamey

p.s. As far as I can tell, this isn't the right list for this question.
The main xorg list may be more appropriate, perhaps.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.x.org/archives/xorg-test/attachments/20060119/3e8c11a0/attachment.pgp 


More information about the xorg-test mailing list