Hi, I was wondering if someone can explain the extra second for transitioning between status changes. Is it supposed to be there, is it not, why is it there sometimes and sometimes not.
In the below attachment I used a shortsleep command that is the following.
#
shortsleep
10usecs sleep 20usecs
50usecs exit
#
So sleeps for basically only 20usecs
u
So ignoring the 0th usecond for the sake of 0 being 0, the 0th usecond is actually dedicated to being a usecond of status change from ready to running.
Anyways from (1 to 5) is 5usecs for status change from ready thats completely fine.
Then the command executing on CPU takes 10 usecs which are from 6 to 15 as shown in the picture.
Then this is the confusing part for me is the 16th usecond an extra usecond for status change or is it included in the status change transition time. If it is the later then why does it specific starting from 17 and not 16th. If former why does only it take an extra usecond for status change only on this occasion and not any other time?
Moving on if we assume that it takes an extra usecond to do the status change, my program is supposed to sleep for 20uses (10 from status change and 10 idiling) however as you can see it only takes 19usecs sleeping, unless we include the 36th usecond as the 20th usecond it sleeps for, something is wrong. But then if we assume that the 36th usec is part of the sleeping time what is the role of the 16th usecond.
Then again you can see when it goes back from sleeping to ready it takes 10usecs which is from 37 to 46. But then the 46th is not used for an extra usec status change like 16th is used.
Honestly all code would make sense if the 16th usecond was part of either the execution time or the sleep time.
Can anyone shed some light on this?
Can someone clarify