home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!cis.ohio-state.edu!magnus.acs.ohio-state.edu!csn!evolving.com!dxs
- From: dxs@evolving.com (Dan Stanger)
- Subject: signal handling
- Message-ID: <1992Sep3.231414.66861@evolving.com>
- Date: Thu, 3 Sep 1992 23:14:14 GMT
- Organization: Evolving Systems, Inc.
- Lines: 32
-
- i want to write a program with the following structure
-
- linked_list
-
- handler()
- {
- put structure on linked list indicating signal
- }
-
- main()
- {
- loop
- disable signals
- check linked list to see if a signal occured
- enable signals
- /* location 1 */
- wait on message queue until message is sent
- disable signals
- check linked list to see if a signal occured
- enable signals
- process either message or signal
- end loop
- }
-
- since the wait on the message queue will be terminated if a signal
- occurs the signal will be handled quickly. however if the signal
- occurs while the program is at location 1 then the signal will not
- be handled until a message comes in.
-
- is there a way around this?
- thanks
- dan stanger
-