Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!uwm.edu!psuvax1!rutgers!mcnc!ecsgate!ecsvax!utoddl From: utoddl@uncecs.edu (Todd M. Lewis) Newsgroups: comp.sys.amiga.tech Subject: Re: Task Switching Problem Message-ID: <1990Oct8.152923.1447@uncecs.edu> Date: 8 Oct 90 15:29:23 GMT References: <1990Sep21.180100.28580@uncecs.edu> <14593@cbmvax.commodore.com> <14900@cbmvax.commodore.com> Organization: UNC Educational Computing Service Lines: 29 In article <14900@cbmvax.commodore.com> valentin@cbmvax.commodore.com (Valentin Pepelea) writes: >A second option would be to use the tc_Switch and tc_Launch vectors of the Task >structure. If the TB_SWITCH flag of the tc_Flags entry is set, then the >routine pointed to by tc_Switch is called every time your task is switched out >and another one is started. If the TB_LAUNCH flag of the tc_Flags entry is set, >then the routine pointed to by tc_Launch is called every time your task is >about to be restarted again. That should do nicely. I can use this to keep a count of each task's activations. My model depends only on how many times tasks have switched, not how much time each task has used. > >Unfortunately, the tc_Switch and tc_Launch functions will be running in >supervisor mode, therefore you will not be able to call the timer.device >functions to find out what the current time is. Strike two. Ground rule double. I don't need the time. And I can fake the Relinquish() call with something like {ULONG i; i=tc_Count; while(i==tc_Count);} since tc_Count would be updated by tc_Switch(). So I waste a few cycles. Thanks. (Why didn't I think of this?) > >Valentin _____ | Todd M. Lewis Disclaimer: If you want my employer's ||\/| utoddl@ecsvax.uncecs.edu ideas, you'll have to || || utoddl@ecsvax.bitnet, @unc.bitnet _buy_ them. | || utoddl@next1.mscre.unc.edu |___ ("Prgrms wtht cmmnts r lk sntncs wtht vwls." --TML)