Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!ucsd!hub.ucsb.edu!peach!mcm From: mcm@peach.ucsb.edu (Marcelo C. Mourier) Newsgroups: comp.os.minix Subject: Alarm handling in 1.5 Message-ID: <5544@hub.ucsb.edu> Date: 30 May 90 08:38:20 GMT Sender: news@hub.ucsb.edu Reply-To: mcm@peach.ucsb.edu (Marcelo C. Mourier) Followup-To: mcm@cs.ucsb.edu Organization: University of California, Santa Barbara Lines: 14 When clock_handler() finds out that an alarm has set off it issues an interrupt(CLOCK) to wake up the clock task. The clock task calls do_clocktick() to do the processing, which consists in scanning the entire proc table looking for a non-null p_alarm entry that is less than or equal to realtime. For speed's sake, wouldn't it be better if the alarms were kept in a linked list? This could be easily done by adding a new entry, p_nextalarm, to the proc structure that would keep the link between the proc table entries of the processes/tasks with pending alarms. In this way, finding the process/task to be awekened would require constant time, instead of O(n). Marcelo - mcm@cs.ucsb.edu