Hi,
On 09/20/2016 09:54 AM, Habeeb P wrote:
> I am reading through muen tool chain source code;
Great to hear that you are diving into the Muen code!
> In *mugenspec* tool you generate the *scheduling group ID*s and creating *reverse
> group ID* to subject ID mappings.
>
> Please explain me, what is the purpose of *scheduling group ID *and
> *Scheduling_Group_Array.
What we mean by scheduling group is a set of subjects that can perform
cooperative scheduling in the minor frames assigned to that group.
Within that group of subjects only one is the currently active subject.
Switching between the different members of the scheduling group is
achieved via handover events.
So each minor frame of a scheduling plan references a scheduling group
and the currently active subject of that group is scheduled during that
minor frame. To give an example of a scheduling group: a Linux subject
and the corresponding subject monitor form a scheduling group.
The Scheduling_Groups constant towards the bottom of the Skp.Scheduling
package specifies for each scheduling group which subject is initially
active and is to be executed in the minor frames that are allotted to
the scheduling group with the given ID.
> One more doubt,*
>
> In *spec-skp_scheduling.adb *file one *scheduling_Groups* array is
> creating with size * (1 .. Last_Group_ID)* and the value of*
> Last_Group_ID = Next_Free_Group_ID - 1*
> by using following code segment,
>
> line 422 Last_Group_ID : constant Natural := Next_Free_Group_ID
> - 1;
> line 423 Scheduling_Groups : array (1 .. Last_Group_ID) of Natural;
>
> *Next_Free_Group_ID *declared with initial value 1,
>
> line 122 Next_Free_Group_ID : Positive := 1;
>
> and value of *Next_Free_Group_ID *incrementing by following code
>
> *line 331 if Subject_To_Group_ID (Subject_Id) = No_Group then
> -- Subject belongs to new scheduling group.
> Subject_To_Group_ID (Subject_Id) := Next_Free_Group_ID;
> Next_Free_Group_ID := Next_Free_Group_ID + 1;line 337 end if;*
> *My question is, *How the size of *Scheduling_Groups* array become (1 .. 6)
> ? (Is there any other code incrementing value of Next_Free_Group_ID
> variable?)
Currently scheduling groups are not explicitly defined in the XML system
policy but are instead implicitly given by the wiring of handover events
between subjects. The subject references of minor frames in the
<scheduling> section of the policy specify the initially active subject
of the corresponding scheduling group. So if you look at the
policy/xml/common_scheduling.xml file you see that there are references
to six different subjects in all minor frames. That is equal to the
number of scheduling groups.
The code in Mugenspec traverses the XML scheduling spec and determines
the number of scheduling groups by counting the number of distinct
subject references.
Note that the scheduling part of the policy and the scheduling groups in
particular may change in the future, e.g. become explicitly defined by
the policy writer.
I hope the provided information helps to clarify your questions.
Regards,
Adrian