[comp.sys.amiga.tech] Software Interupts

jdickson@jato.Jpl.Nasa.Gov (Jeff Dickson) (08/28/90)

	Hi all.

	I was curious if a software interupt posted as a result of a
message arriving at a message port would take precedence over Wait(),
WaitPort(), Execute(), and Lock() ?

				Thanks, Jeff

valentin@cbmvax.commodore.com (Valentin Pepelea) (08/29/90)

In article <4689@jato.Jpl.Nasa.Gov> jdickson@jato.Jpl.Nasa.Gov (Jeff Dickson)
writes:
>
>	I was curious if a software interupt posted as a result of a
> message arriving at a message port would take precedence over Wait(),
> WaitPort(), Execute(), and Lock() ?

A message port can be set to have one of four actions performed when a message
arrives. The standard one, on which Wait() and WaitPort() depend, is that a
task gets signaled (PA_SIGNAL). In the struct MsgPort definition:

UBYTE mp_Flags			what action to take (PA_SIGNAL)
UBYTE mp_SigBit			specified the signal bit to be set
struct Task *mp_SigTask		points to the task to be signalled

You may choose to have a software interrupt generated instead (PA_INTERRUPT).
In that case *mp_SigTask points to an Interrupt structure, while the mp_SigBit
field is ignored. Task switching times are much faster for software inteerupts
than tasks, so you might prefer to set up a software interrupt than have a
task signalled to perform an action. Read Carl Sassenrath's "Guru's Guide #1 -
Interrupt" for more information.

You may also choose to have a specific subroutine executed. The *mp_SigTask
field points to the subroutine in that case, which is executed under the
context of the task (or interrupt) that called PutMsg().

And the last option is to have absolutely nothing done. (PA_IGNORE)

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