From: tdu AT enter DOT net (Tim Updegrove) Newsgroups: comp.os.msdos.djgpp Subject: Re: Algorithm for integer timing loop Message-ID: <3921dc0e.611684@news.enter.net> References: X-Newsreader: Forte Free Agent 1.11/32.235 Lines: 28 Date: Tue, 16 May 2000 23:55:01 GMT NNTP-Posting-Host: 207.18.10.197 X-Complaints-To: Abuse Role , We Care X-Trace: newshog.newsread.com 958521301 207.18.10.197 (Tue, 16 May 2000 19:55:01 EDT) NNTP-Posting-Date: Tue, 16 May 2000 19:55:01 EDT Organization: ENTER.net (enter.net) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com A user of my program may terminate it with a Ctrl+C because they are impatient waiting for some event or if the program hangs (I'm implementing timeouts so this will occur less). I'm not familiar with how to block SIGINT. Do I need to block it for the entire program or just before & after calling uclock? I'm also not familiar with 'signal' and the other 2 items. I guess they are ways to terminate programs or at least provide some flag to a program? Does anyone know of a "fix" for uclock as Eli has hinted at? Thank-you for all your help. On Tue, 16 May 2000 17:00:06 +0300 (IDT), Eli Zaretskii wrote: >A simple solution is to block SIGINT while you run that loop. You don't >really need to stop it with Ctrl-C, do you? You could, for example, use >`signal' and SIG_IGN, or `sigprocmask' for that. > >It is also possible that some changes inside `uclock' will make it more >robust in these cases (e.g., perhaps there's some command to reset the >PIT, and if used inside `uclock', it would restore the virtualized PIT >to its normal state). But I didn't have enoug time to look for such a >solution; volunteers are welcome, as usual.