Subj : Re: How to manage time-slicing in Pthreads programs? To : comp.programming.threads From : Marcin 'Qrczak' Kowalczyk Date : Sun Feb 20 2005 09:41 pm "David Schwartz" writes: >> Which require checking them in regular intervals. Most Unix programs >> don't have a GUI. I'm glad that they can be promptly interupted >> without the programmer having to remember to spread checks for an >> event queue over the program. > > Obviously, you need a way to interrupt a broken program in a very harsh > way. But for normal termination, the program has to process the shutdown > request politely anyway. Allowing ^C to have its default behavior of > terminating the program ungracefully is adequate in only trivial programs. The model of explicit checking for the request can be implemented in terms of Unix signals: the signal handler sets a flag and the program checks the flag from time to time. The converse is not true. So the OS should provide Unix signals. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/ .