libX11 and thread-safety

Alan Coopersmith Alan.Coopersmith at Sun.COM
Sat Jun 18 21:28:06 PDT 2005

Jim Gettys wrote:
> If anyone has fixes in their source pools, it would be good to pick them
> up of course.  Even there, patches will have to be looked at very
> carefully, as it is difficult code: "first, do no harm".

For what it helps I dug up Sun's fixes in this area that aren't in the CVS
head yet and made them available at:

There's 4, including one I didn't even realize we had - it loosens the
rules for calling XInitThreads() from "before any other Xlib call is
made" to "before any other Xlib call is made from another thread" so
that libraries can use multiple threads to access Xlib even if the
program is not and doesn't call XInitThreads() itself.  (I'm sure the
people who've had to debug Xlib MT issues are recoiling in horror at
the thought of what this could enable, while the people who work on
libraries built on top of X are sitting there eagerly thinking of
what this could enable.)

The big one in Solaris Xlib not included there is the fixes to make
XIM/XOM thread safe.   I need to check with our i18n groups before
releasing it (though if people are moving from XIM to IIIMF it may
not be that interesting anyway).

	-Alan Coopersmith-           alan.coopersmith at
	 Sun Microsystems, Inc. - X Window System Engineering

More information about the xorg mailing list