- The problem statement, all variables and given/known data:
[LEFT]Type `vmstat -s; vmstat -n 1 5; vmstat -n 1 5; vmstat
-s` to your Ruby interpreter. Then terminate your Ruby session. Run the Unix com-
mand vmstat -s; vmstat -n 1 5; vmstat -s in the same terminal window you had
been using for Ruby. Did the context-switching rate of your system change signi cantly,[/LEFT]
after the Ruby interpreter was shut down? Explain briey.
-
Relevant commands, code, scripts, algorithms:
-
The attempts at a solution (include all code and scripts):
So what i did is:
After typing this command "vmstat -s; vmstat -n 15; vmstat -n 15; vmstat -s"
I found 2 context switches. The one is 707227535 and the other one is 707222952. I substracted them and divided by 10 as the "vmstat -n 1 5" five times in duration of one second per line. Because it does this 2 times than my calculation looks like that:
context switches per second = (707227535-707222952)/(2x5)=458
After terminating Ruby interpreter i typed: "vmstat -s; vmstat -n 1 5; vmstat -s"
and the calculation goes like that:
context switches per second = (707306157-707303877)/5=456
The questions are:
- Am i doing the right calculations for context switches?
- What does it mean that the resolt in both cases is so close to each other?
Thank you with advance.
- Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
University of Auckland
Auckland City
New Zealand
Clark Thomborson