[comp.windows.x] asyncronous event notifcation/XNextEvent daemon

eric@eddie.MIT.EDU (Eric Van Tassell) (11/22/88)

I am trying to interface Xlib to an object oriented language. My problem
, or at least the problem I can percieve, is that it is too expensive to
poll X using XNextEvent. What I want is asynchronous notification that
an X event has happened. The way I proposed to do this was to have a daemon
and the interpreter communicate through shared memory. When the interpreter
fires up it attaches the shared memory and puts it's display pointer there
and solicits events (KeyPress,ButtonPress, etc). It then execs the daemon
who looks in shared memory to find dpy and then calls XNextEvent. This much
works. What happens next is that the daemon dies with SIGTTIN in

	Xread(....)
	XReadEvents(....)
	XNextEvent(.....)


What I would like to happen is for:

	- XNextEvent to return without hassling me
	- The daemon to send a SIGUSR1 to the interpreter so that
	  the interpreter can set a bit from his signal handler and deal
	  with the event when he can


Could someone with a knowledge of Xlib internals tell me:

	- If what I am trying to do is remotely possible
	- If it is sensible
	- What I am doing wrong to make XRead bomb
	- A better way to get asyncronous notification of X events in unix


TIA

			dlcdev!eric@eddie.mit.edu
			Eric Van Tassell