[xorg-bugzilla-noise] [Bug 809] (Expose-)Events not received by MT Xt-application until further events generated

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Jul 30 05:57:05 PDT 2004


Please do not reply to this email: if you want to comment on the bug, go to         
the URL shown below and enter yourcomments there.  
  
https://freedesktop.org/bugzilla/show_bug.cgi?id=809       
  




------- Additional Comments From luik at orthogon.de  2004-07-30 05:57 -------
OK, I spend some further time analyzing what's going on here.  Two threads are
involved, one (lets call it the "Xt loop" thread) does an XtAppMainLoop(), the
other one ("playback") occasionally does some Xlib calls (via XtSetValues/
XtManageChild etc, but I think this does not matter).

When the problems shows up, the following has happened:

The Xt loop thread sits in select(), called from _XtWaitForSomething(), waiting
for input from the X display connection.

The playback thread at the same time is processing Xlib calls, and reads replies
from the X server (_XReply), and also calls _XWaitForReadable multiple times.
The select() system call called from _XWaitForReadable returns, because some
data from the X server is available.  While processing the replies, also some
events are read and put into the display's event list.

Unfortunately, the select() call of the Xt loop thread does NOT return while the
playback thread reads replies and events from the connection.  (I've verified
that the two select() calls use the same file descriptor in the read-mask and
the max-fd parameter.)

So, finally some events are queued on the dpy's event list, but the Xt loop
thread still waits via select(), and won't process these, until
_XtWaitForSomething will eventually return, for example, if another event
(like key/button press) occurs.  (Of course, the playback thread never tries
to process X events.)

Now, I'm stuck.  I'm afraid it is undefined whether select() called from
multiple threads will return in one, several or all threads if input becomes
available.  Correct?  And then it seems to be difficult to fix this
synchronization problem between Xlib and Xt's XtWaitForSomething ...

Any (helpful ;-) comments?
- Andreas
       
  
  
--        
Configure bugmail: https://freedesktop.org/bugzilla/userprefs.cgi?tab=email      
  
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the xorg-bugzilla-noise mailing list