[comp.sys.amiga.tech] C programming/mutitasking query

owhite@nmsu.edu (Owen White) (11/20/89)

I have a program that I've written that displays on the current screen
a insect (sprite-driven) that I usualy run in the backround, much like
the infamous oing-series written by leo schwab.  I am looking for
suggestions on how I can interupt this program during disk
accesses/compiling/other expensive cpu accesses.  I guess the buzzing
insect has so many WaitTOF()s that the little guy really slows
up the system, especially text scrolling.
	netiquette:TIA :-)      thanx in advance
ps. if anyone wants the insect thing I'd be all too happy...   
--
 __ __     __ __     __ __     __....hey aliens:                 __ __
/  X  A   /  X  C   /  X  \   / we are flesh and blood and DNA, /  X  U
  / \  T /  / G  G /  / \  \ / formed out out of the big bang's decay  A
_/   \__G__/   C__X__/   \__X__/   owhite@nmsu.edu  (Owen White)      \ G

cmcmanis%pepper@Sun.COM (Chuck McManis) (11/20/89)

In article <OWHITE.89Nov19135047@haywire.nmsu.edu> (Owen White) writes:
>I have a program that I've written that displays on the current screen
>a insect (sprite-driven) that I usualy run in the backround, much like
>the infamous oing-series written by leo schwab.  I am looking for
>suggestions on how I can interupt this program during disk
>accesses/compiling/other expensive cpu accesses.  

Easy one Owen, since the Amiga has a preemptive scheduler you can just
set the priority of your insect to a value that is lower than the trackdisk
task and "standard" tasks. Then when ever *you* need the CPU to do something
you get it, no questions asked, but if no one needs it, your sprite task
gets it.

>I guess the buzzing insect has so many WaitTOF()s that the little guy really 
>slows up the system, especially text scrolling.

WaitTOF() is friendly because it does a real wait, it's WaitBOVP() that does
the busywait.

--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@Eng.Sun.COM
These opinions are my own and no one elses, but you knew that didn't you.
"If it didn't have bones in it, it wouldn't be crunchy now would it?!"