pat@seradg.Dayton.NCR.COM (Patrick Pesch) (09/18/87)
From time to time we come up with the need to set timers within user mode applications for such things as message response timeouts, etc... While the SIGALRM signal used with alarm(2) is okay for some situations, it lacks a lot of functionality, such as: o Less than 1 second granularity o Multiple simultaneous outstanding timers o Uses signals, which may not be reliable in all Unix variants (true?) o Not very accurate when there are *lots* of processes that are runnable (not sleeping) What I would like to know is if anyone else out there had come across this sort of application, and if any solutions were found. ANY suggestions would be appreciated... It seems to me there should be a way to write a little "timer pseudo driver" that would help processes set/unset timers, and allow processes with timers expiring to get scheduled "quicker" than other normal processes by fiddling with there priorities or something... I realize that Unix is *NOT* a real time OS, but I don't really need a true real time system... ?comments? Patrick Pesch NCR Corporation Dayton OH
usenet@mcdchg.UUCP (09/30/87)
You it the nail on the head. Write a device driver that sleeps on the callout table for the desired number of ticks (the standard idiom is to use the number of bytes requested in a read/write pseudo call to the device driver). After sleep() returns, mung on the priority as needed to get the scheduler to run that job next. I believe you only need to set the priority below curpri to get yourself running again. Also - don't forget to sleep at a very high priority or the wakeup will take longer. You will want to provide some security for this device as it could be used by impatient department heads to get their work done fast ... - John. --- John F. Haugh II HECI Exploration Co. Inc. UUCP: ...!ihnp4!killer!jfh 11910 Greenville Ave, Suite 600 "Don't Have an Oil Well?" Dallas, TX. 75243 " ... Then Buy One!" (214) 231-0993