Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!rochester!rit!ultb!lmb7421 From: lmb7421@ultb.UUCP (L.M. Barstow) Newsgroups: comp.sys.apple Subject: Re: Automatic Switching Message-ID: <1119@ultb.UUCP> Date: 6 Aug 89 23:35:36 GMT References: <8908042018.aa02545@SMOKE.BRL.MIL> Reply-To: lmb7421@ultb.isc.rit.edu.UUCP (L.M. Barstow) Organization: Wandering Damage, Cosmo Police, Psi division Lines: 35 Re: switching between the two programs.... On a GS, if the program that you want to run at night is home-grown, you could install it as an init file of some sort, and install it into the HeartBeat Interrupt queue with no major problem or slow-down. Make the file a permanent init file, Make most of the code dynamically loaded (so that it takes up minimal space) if you have the program on a disk which is always in the drive (on hard drive, etc) Find the time from the Misc Tools Calculate the number of tick until the program should switch (not hard - subtract the current time from the time you want it to run - then do some math to come up with 30 ticks for every second difference.) Install the program into the HeartBeat Interrupt queue with the calculated number of ticks. end the program. The boot sequence should leave everything intact, and other programs whould run over top with no big problem (small slowdown, but nothing huge) And when the other program is due to take over, it should switch right in...only one problem I see, and that is that GS/OS may be tied up when you interrupt, and you won't be able to do any disk access. This should be solveable by re-installing the task back into the queue for a few seconds, and checking again. I haven't found any reason in the tech notes or docs why this wouldn't work as a primitive switcher, although I wouldn't want to push it too hard. Any comments from those in the know? -- Les Barstow |Bitnet: LMB7421@RITVAX "What about the R.O.U.S's?" |UUCP: ...rutgers!rochester!ritcv!ultb!lmb7421 "The Rodents Of Unusual Size? |ARPA: lmb7421@ultb.isc.rit.edu I don't believe they exist!" - Buttercup and Wesley, _The Princess Bride_