Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!aplcen!haven!decuac!bacchus.pa.dec.com!decwrl!klee From: klee@wsl.dec.com (Ken Lee) Newsgroups: comp.windows.x Subject: Re: Awaiting _non_ X events, was Re : XtAddTimeOut() .... Message-ID: <1990Aug31.164625.1880@wrl.dec.com> Date: 31 Aug 90 16:46:25 GMT References: <9008231943.AA01202@crc.skl.dnd.ca> <141292@sun.Eng.Sun.COM> <4039@husc6.harvard.edu> <2324@kiwi.mpr.ca> Sender: news@wrl.dec.com (News) Reply-To: klee@wsl.dec.com Organization: DEC Western Software Laboratory Lines: 20 In article <2324@kiwi.mpr.ca>, janzen@bambi.mpr.ca (Martin Janzen) writes: |> - My application starts up, creates an IPC queue, registers a SIGUSR2 |> handler, and sends an IPC message to the server's queue to register |> my program's new IPC queue id and pid (this part's pretty ugly :-). |> - When the server has data for my program, the server enqueues an IPC |> message and sends a SIGUSR2 signal to my program. On many UNIX systems, signals are fairly inefficient. An alternative that is often useful is to open a pipe or socket connection between the 2 processes and send an empty packet across it whenever you have something on the IPC queue. The XToolkit allows you to register callbacks on file descripters (as from pipes and sockets), which can then handle the IPC queue. This technique is commonly used in the UNIX world, not just for X stuff. Ken Lee DEC Western Software Laboratory, Palo Alto, Calif. Internet: klee@wsl.dec.com uucp: uunet!decwrl!klee