<html>
<head>
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 22.01.2013 21:11, zeljko wrote:
<blockquote cite="mid:201301221911.45456.zeljko@holobit.net"
type="cite">
<pre wrap="">On Tuesday 22 of January 2013 19:04:43 Anton Kavalenka wrote:
</pre>
<blockquote type="cite">
<pre wrap="">On 22.01.2013 20:56, zeljko wrote:
</pre>
<blockquote type="cite">
<pre wrap="">On Tuesday 22 of January 2013 18:52:31 Anton Kavalenka wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Dear Lazarus developers!
I'm examining the problem disturbing me for years.
GTK2 applications provide thread-safety using internal mutexes passed
through gdk_thread_init()
And it works.
Pure X-Applcation does so (orders X-messages per-thread) using
XInitThreads at early start of application.
And it also works
But GTK Widgetset uses pure Xlib calls for determining keyboard states.
Xlib thread-safety is not initialized in GTK2 widgetset.
IMO the problem half-way to resolve - either not use Xlib calls (pure
GTK2,3 - it is threadsafe) or make GTK and Xlib interoperable.
Or block GTK calls until Xlib call returned.
</pre>
</blockquote>
<pre wrap="">
Feel free to provide patch.
zeljko
</pre>
</blockquote>
<pre wrap="">
I'd like to, but i'm not a great expert in X - so i've subscribed to the
list to discuss.
using XinitThreads at start of the program blocks GTK painting.
Forms are shown, but no text output.
So - no way to alter XLib internals. The only way - to initialize GTK
threading in a way compatibel with X.
</pre>
</blockquote>
<pre wrap="">
So no way to use critical sections while calling xlib directly ?
Can you open an issue and attach example ?
z.
</pre>
</blockquote>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-15">
<a href="http://www.remlab.net/op/xlib.shtml">http://www.remlab.net/op/xlib.shtml</a><br>
<br>
They say - there is a way<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-15">
<p style="margin: 1em; text-align: justify; color: rgb(0, 0, 0);
font-family: 'Times New Roman'; font-size: medium; font-style:
normal; font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: normal; orphans: auto; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px;">Xlib provides two groups of
functions for multi-thread use:</p>
<blockquote style="margin: 1em 1em 1em 2em; text-align: justify;
color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size:
medium; font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal; orphans:
auto; text-indent: 0px; text-transform: none; white-space: normal;
widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px;">
<pre>/* Thread-safety for global data */
Status XInitThreads(void);
/* Thread-safety for an individual display */
void XLockDisplay(Display *display);
void XUnlockDisplay(Display *display);
</pre>
</blockquote>
GNOMErs blame Xlib<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-15">
<a
href="https://mail.gnome.org/archives/gtk-list/2007-November/msg00122.html">https://mail.gnome.org/archives/gtk-list/2007-November/msg00122.html</a><br>
<br>
I'll try to provide example.<br>
<br>
Actually GUI does not need the multhreading. <br>
But rendering into TBimap invokes Xlib calls as side effects.<br>
So no way to compose off-screen.<br>
<br>
regards,<br>
Anton<br>
<br>
<br>
<br class="Apple-interchange-newline">
<br>
</body>
</html>