Article View: comp.sys.amiga.tech
Article #5678Re: Task Switching Problem
From: Todd M. Lewis
Date: Mon, 08 Oct 1990 15:29
Date: Mon, 08 Oct 1990 15:29
29 lines
1996 bytes
1996 bytes
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)
Technical Details
Message-ID:
<1990Oct8.152923.1447@uncecs.edu>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!uwm.edu!psuvax1!rutgers!mcnc!ecsgate!ecsvax!utoddlReferences:
<1990Sep21.180100.28580@uncecs.edu> <14593@cbmvax.commodore.com> <14900@cbmvax.commodore.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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