how the timeshared in cloudsim work in cloudsim?

后端 未结 2 922
面向向阳花
面向向阳花 2021-01-24 08:15

how the timeshared in cloudsim work, there is no variable that represent a time slice or quantum, so how the concept of round robin is verified in cloudsim?

If we have 5

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-24 08:58

    In fact, the CloudletSchedulerTimeShared in CloudSim does not implement the concept of time slice/quantum. Consider we have a VM with 1 CPU (PE) of 1000 MIPS and 2 Cloudlets running inside it. CloudSim's CloudletSchedulerTimeShared provides an oversimplified implementation that allocates 500 MIPS for each Cloudlet, making them run at the same time on the same CPU.

    If the VM had only one Cloudlet with a length of 5000 MI, then the Cloudlet would take 5 seconds to finish. Since there are 2 Cloudlets, in a time-shared scheduler for that single-core VM, each Cloudlet running interchangeably would take 10 seconds to finish. Allocating only half of the CPU capacity (500 MIPS) for each one of the 2 Cloudlets, making them run in parallel as if there were 2 CPU cores, will produce the exact same result: each Cloudlet finishing in 10 seconds.

    The point is that there is no waiting time for any Cloudlet. These Cloudlets will run as if the VM had 2 CPUs with 500 MIPS each. If you are assessing Cloudlets' wait time in your simulations, such results are just wrong. If the wait time is not a concern, the results are fine.

    If you really need to assess Cloudlets' pre-emption process, you can check CloudSim Plus, it's a full-featured, state-of-the-art, completely re-engineered and actively maintained CloudSim fork. It provides an implementation of the Completely Fair Linux Scheduler that performs actual preemption and considers a time slice to run Cloudlets. Check the CloudletSchedulerCompletelyFair and the LinuxCompletelyFairSchedulerExample.

提交回复
热议问题