uk.ac.man.cs.rainbow.simulator.rasm
Class IsAvailable
java.lang.Object
|
+--uk.ac.man.cs.rainbow.simulator.Instruction
|
+--uk.ac.man.cs.rainbow.simulator.rasm.IsAvailable
- All Implemented Interfaces:
- Serializable
- public class IsAvailable
- extends Instruction
Test channel for availability.
Places on the stack whether an input channel, chanId,
has a request waiting to be serviced. This does not cause the
thread to become descheduled (isAvailable is rather
like chan_ready in LARD) and can be used safely on the
same channel multiple times in the same activation of a thread)
but may trigger slightly different behaviour in the scheduler
upon execution if the next sleep instruction under
certain circumstances (i.e. where the scheduler is executing
threads in a backwards direction, this instruction will always
return a false value, and will cause the thread to be scheduled
in the reverse direction when the next sleep is
encountered instead of simply not being scheduled at all until
another thread requests it.)
chanId
boolean
- See Also:
SignalForward
,
WaitRelease
,
Release
, Serialized Form
IsAvailable
public IsAvailable()
IsAvailable
public IsAvailable(RASMCode code)
toString
public String toString()
- Overrides:
toString
in class Object
execute
protected boolean execute(RASMThread thread)
throws RASMThread.Exception
- Description copied from class:
Instruction
- Make this instruction execute in the given context.
- Overrides:
execute
in class Instruction
- Following copied from class:
uk.ac.man.cs.rainbow.simulator.Instruction
- Throws:
RainbowException
- All sorts of things can go wrong during execution...