You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been experimenting with the abstr3_proc_sched program as per the instructions provided in the course materials. Initially, I ran ./abstr3_proc_sched 3 to observe its behavior, specifically the rate at which it prints output. As expected, the program's execution seemed to slow down, which led me to explore how pinning processes to different CPUs would affect performance.
My assumption was that running ./abstr3_proc_sched 3 concurrently with different target CPUs (e.g., ./abstr3_proc_sched 3 and ./abstr3_proc_sched 4) wouldn't slow down the output printing speed as much, since each process would have a dedicated CPU. However, the results didn't entirely meet my expectations.
Here are the details of my experiments:
Case 1: Single Instance Execution
I executed time ./abstr3_proc_sched 3 and terminated the process after the 30th print statement. The time measurements were as follows:
...
[ 2336 pinned to: 3 running on: 3] 29
[ 2336 pinned to: 3 running on: 3] 30
^C
real 0m14.019s
user 0m13.980s
sys 0m0.035s
Case 2: Concurrent Execution on the Same CPU
Next, I ran two instances of time ./abstr3_proc_sched 3 simultaneously, stopping both after the 30th print statement. The observed times were:
[ 2336 pinned to: 3 running on: 3] 29
[ 2336 pinned to: 3 running on: 3] 30
^C
real 0m26.709s
user 0m26.473s
sys 0m0.234s
Case 3: Concurrent Execution on Different CPUs
Finally, I executed time ./abstr3_proc_sched 3 and ./abstr3_proc_sched 4 together, again terminating after the 30th print statement. The timing results were:
...
[ 2336 pinned to: 3 running on: 3] 29
[ 2336 pinned to: 3 running on: 3] 30
^C
real 0m27.642s
user 0m13.942s
sys 0m0.047s
From these experiments, I noticed that even when running processes on separate CPUs, the printing speed didn't improve as much as I anticipated, particularly in terms of real time.
Question: Why does running the processes on different CPUs slow down the printing speed?
The text was updated successfully, but these errors were encountered:
This actually happens due to the UTM environment.
In the UTM emulation environment, the CPUs visible on the VM are virtual and do not have a one-to-one relation with the physical cores by default.
If you select "Force Multicore" in the VM editing options, UTM will try to utilize the system's multiple cores.
Then, time ./abstr3_proc_sched 3 shows the (almost) same time regardless of the presence of ./abstr3_proc_sched 4.
Also, if you run the same experiments on a VirtualBox (which uses virtualization) or on a native machine, it will show the expected results.
I've been experimenting with the abstr3_proc_sched program as per the instructions provided in the course materials. Initially, I ran
./abstr3_proc_sched 3
to observe its behavior, specifically the rate at which it prints output. As expected, the program's execution seemed to slow down, which led me to explore how pinning processes to different CPUs would affect performance.My assumption was that running
./abstr3_proc_sched 3
concurrently with different target CPUs (e.g.,./abstr3_proc_sched 3
and./abstr3_proc_sched 4
) wouldn't slow down the output printing speed as much, since each process would have a dedicated CPU. However, the results didn't entirely meet my expectations.Here are the details of my experiments:
Case 1: Single Instance Execution
I executed
time ./abstr3_proc_sched 3
and terminated the process after the 30th print statement. The time measurements were as follows:Case 2: Concurrent Execution on the Same CPU
Next, I ran two instances of
time ./abstr3_proc_sched 3
simultaneously, stopping both after the 30th print statement. The observed times were:Case 3: Concurrent Execution on Different CPUs
Finally, I executed
time ./abstr3_proc_sched 3
and./abstr3_proc_sched 4
together, again terminating after the 30th print statement. The timing results were:My environment:
From these experiments, I noticed that even when running processes on separate CPUs, the printing speed didn't improve as much as I anticipated, particularly in terms of real time.
Question: Why does running the processes on different CPUs slow down the printing speed?
The text was updated successfully, but these errors were encountered: