Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!INTELLICORP.COM!PARCEL From: PARCEL@INTELLICORP.COM (Scott Parcel) Newsgroups: comp.windows.x Subject: Re: Problem with Signals Message-ID: <9003061933.AA03304@expo.lcs.mit.edu> Date: 6 Mar 90 19:35:36 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 21 >This wouldn't solve the original problem I had that started all this. I wanted a >way for my process to wake up periodically and flush out the event queue to >keep it from overflowing. For instance, what if I had a model solver that was >going to take 7 hours to run a solve on a model. The user clicks a SOLVE widget >and its out of the event loop for 7 hours. During that time all kinds of events >could be received into the queue and not serviced causing it to eventually >overflow. I wanted to use setitimer and signal to periodically check the queue, >but the problems I had are what started this discussion. Perhaps I'm repeat prior info, but, to process events during the 7 hour loop I'd: 1. Setup to get SIGIO signals when X event data arrives on the event queue. 2. Mask signals or use some other protection technique to only allow processing the signals and the event queue when you know its safe. (Safe to me means your not in the middle of any nonreentrant functions which might be called during the signal handler event processing.) If your only concerned with using the signal handler to process events during a 7 hour mathmatical computation this might be easy. I'm doing this kind of thing and it works fairly well. There are some more refinements which can be needed in some situations. -- scott parcel@intellicorp.com -------