Download 1 Introduction

Transcript
Figure 3. "Scheduling within an object" will show all this in detail. In (a) object A selects message M1 to
process since there are no waiting methods in the Blocking List. When processing method M1 it will be
blocked, and in (b) put it self in the Blocking List along with the methods Stack Pointer (SP for short) and
its Program Counter (PC), finally a flag indicating that the method in Blocking List is really blocked.
In order to continue the processing of object A it select to process method M2 which is the next method call
in the Input Queue since there are no runnable methods to process in the Blocking List, this is illustrated in
(c). During the time of processing M2 the method M1 becomes unblocked (or Free) as in (d). This is
marked in the Blocking List.
Finally when M2 has finished processing, the object A will try to find something new to process it will
begin by looking in the Blocking List and finds that M1 has been set free and starts executing it (e). At last
when M1 has finished processing object A selects to process the second method M2 because there are no
methods waiting in the Blocking List.
Input queue
M2
M2
M1
Object A
Method M1
Method M2
Getting M1
Method M1
1 Do something
2 Block
3 Continue
4 Exit method
Object A
Method M1
1 Do something
2 Block
3 Continue
4 Exit method
Method M1
Method M2
Blocking List
Blocking List
M1 SP PC Blck
(a)
(b)
Input queue
M2
M2
Object A
Method M1
Method M2
Getting M2
Method M2
1 Do something
2 Exit method
Object A
Method M2
1 Do something
2 Exit method
Method M1
Method M2
Blocking List
M1 SP PC Free
Blocking List
M1 SP PC Blck
(c)
(d)
5