🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #14024

Re: Task Switching

#14024
From: Valentin Pepelea
Date: Sun, 04 Mar 1990 06:48
28 lines
1888 bytes
In article <7779.AA7779@caleb> jdp@caleb.UUCP (Jim Pritchett) writes:
>
>Is there some sort of task switch interrupt chain?  I'm probably not
>describing this correctly.  What I would like to do is to somehow have
>my C code called each time that the Amiga switches tasks.  (I want to
>check some things and identify which task just swapped out.)  Is this
>doable?  Is it too difficult?  Any suggestions?

Well, the only approved way doing something similar is using the
(*tc_Switch)() and (*tc_Launch)() fields of a task control block. These
fields point to functions which are to be called when that particular
task loses or regains control.

In order to trap every single arbitrary task switch, you'd have to SetFunction()
the Switch() function, but even that would not trap interrupt context
switches. (interrupts run as separate "micro-tasks" - Bryce's term) Needless
to say, this is totally unsupported and is likely to lead to truble with
future versions of the operating system.

Now, what do you mean by "...and identify which task just swapped out." Are
you trying to implement virtual memory? I would find that very interesting.

Valentin
-- 
The Goddess of democracy? "The tyrants     Name:    Valentin Pepelea
may distroy a statue,  but they cannot     Phone:   (215) 431-9327
kill a god."                               UseNet:  cbmvax!valentin@uunet.uu.net
             - Ancient Chinese Proverb     Claimer: I not Commodore spokesman be
Technical Details
Message-ID: <9970@cbmvax.commodore.com>
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!jarvis.csri.toronto.edu!rutgers!bpa!cbmvax!valentin
References: <7779.AA7779@caleb>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!jarvis.csri.toronto.edu!rutgers!bpa!cbmvax!valentin
From: valentin@cbmvax.commodore.com (Valentin Pepelea)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Task Switching
Message-ID: <9970@cbmvax.commodore.com>
Date: 4 Mar 90 06:48:24 GMT
References: <7779.AA7779@caleb>
Reply-To: valentin@cbmvax (Valentin Pepelea)
Organization: Commodore, West Chester, PA
Lines: 28