Subj : Re: How to manage time-slicing in Pthreads programs? To : comp.programming.threads From : Joe Seigh Date : Sun Feb 20 2005 11:18 am On Sun, 20 Feb 2005 16:43:09 +0100, Marcin 'Qrczak' Kowalczyk wrote: > "Joe Seigh" writes: > >>> How would you design a mechanism which allows the user to press ^C to >>> abort a program? Or set up a timer for a userspace thread scheduler? >>> >>> I'm not saying that I like signals, but I don't know how an alternative >>> could look like. >> >> It would look like the synchronization mechanisms in pthreads or >> built on top of it. > > How? > > The program wants some action to be executed when the user presses ^C > or when a timer expires. How the action would be executed? In a newly > created thread? What would it use to notify the main thread that it > should abort what it is currently doing in some convenient place? > [...] > > If you don't mean running the handler in its own thread, then what? > >> Also the windows synchronization api which doesn't have signals. > > What does it use for ^C and timers? How is the timer action executed? Most GUI's use event queues. Most of the synchonization api on windows, unix, and java has timeout options. -- Joe Seigh .