Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!ucsd!usc!snorkelwacker!bloom-beacon!LARRY.MCRCIM.MCGILL.EDU!mouse From: mouse@LARRY.MCRCIM.MCGILL.EDU (der Mouse) Newsgroups: comp.windows.x Subject: Re: Is X11R3 re-entrant? Message-ID: <9007231054.AA02140@Larry.McRCIM.McGill.EDU> Date: 23 Jul 90 10:54:57 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 31 > Can anyone tell me how reentrant the code in R3 is? The stuff from MIT, run on anything approximating a typical UNIX system, not very. > In particular, what I'm trying to find out is "how safe it is to use > Xt and Xlib calls from inside a signal handler (namely SIGALRM - > alarm (2))?" Xlib should be OK provided you use a separate connection to the display. Xt would be too, except that Xt does not behave well in the presence of two connections in the same program (or so I understand). If you use the same connection in the main line and at signal-handler level, eventually a signal will interrupt a main-line call at a critical time and you'll get burned. > My application uses Xaw to set up an interactive control pannel and > then periodically goes off, does some work and then updates output > windows (which contain widgets) and so forth. This "going off" is > triggered by a SIGALRM. So far I haven't had any problems making > toolkit calls from within the handler, but a friend suggested this > might be a dangerous thing to do. You make it sound as though the main-line is not doing any X interaction when the signal happens. If you can guarantee this, you should be OK. If this is not true, well, read my paragraph above.... der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu