What I mean is I have an X app that starts a worker thread. The main thread handles the gui and sends /gets commands/responses from the worker thread. The worker thread, wel performs work. In Windows I would use the PostThreadMessage() and PostMessage() to do this. How could this be done in X.
From the gui to the worker thread is no problem. Set up a mutex protected queue between the two and the thread does a conditional wait until teh gui posts something.
But, can the thread put a special event on the gui's event handler and teh gui have a callback for that event?
I guess you could have a queue from worker thread to gui and the gui check it in the event loop handler. Instead of using XtAppMainLoop() you would do this:
for(;;){
if(CheckThreadQueue()) ProcessQueueData();
if(XtPeekEvent){
XtAppNextEvent();
XtDispatchevent();
} }
PS: I am no X expert by a long shot. I have use mostly Tcl/Tk and xforms and very little low level, Xt, programming.
Jeff wd4nmq@xxxxxxxxxxx
_______________________________________________ XFree86 mailing list XFree86@xxxxxxxxxxx http://XFree86.Org/mailman/listinfo/xfree86