Class CloudletSchedulerTimeShared
- All Implemented Interfaces:
java.io.Serializable
,CloudletScheduler
- Direct Known Subclasses:
CloudletSchedulerCompletelyFair
public class CloudletSchedulerTimeShared extends CloudletSchedulerAbstract
Cloudlets
. Cloudlets execute in
time-shared manner in VM. Each VM has to have its own instance of a
CloudletScheduler. This scheduler does not consider Cloudlets priorities
to define execution order. If actual priorities are defined for Cloudlets,
they are just ignored by the scheduler.
It also does not perform a preemption process in order to move running Cloudlets to the waiting list in order to make room for other already waiting Cloudlets to run. It just imposes there is not waiting Cloudlet, oversimplifying the problem considering that for a given simulation second t, the total processing capacity of the processor cores (in MIPS) is equally divided by the applications that are using them.
In processors enabled with Hyper-threading technology (HT),
it is possible to run up to 2 processes at the same physical CPU core.
However, usually just the Host operating system scheduler (a VmScheduler
assigned to a Host)
has direct knowledge of HT to accordingly schedule up to 2 processes to the same physical CPU core.
Further, this scheduler implementation
oversimplifies a possible HT for the virtual PEs, allowing that more than 2 processes to run at the same core.
Since this CloudletScheduler implementation does not account for the context switch overhead, this oversimplification impacts tasks completion by penalizing equally all the Cloudlets that are running on the same CPU core. Other impact is that, if there are Cloudlets of the same length running in the same PEs, they will finish exactly at the same time. On the other hand, on a real time-shared scheduler these Cloudlets will finish almost in the same time.
As an example, consider a scheduler that has 1 PE that is able to execute
1000 MI/S (MIPS) and is running Cloudlet 0 and Cloudlet 1, each of having
5000 MI of length. These 2 Cloudlets will spend 5 seconds to finish. Now
consider that the time slice allocated to each Cloudlet to execute is 1
second. As at every 1 second a different Cloudlet is allowed to run, the
execution path will be as follows:
Time (second): 00 01 02 03 04 05
Cloudlet (id): C0 C1 C0 C1 C0 C1
As one can see, in a real time-shared scheduler that does not define priorities
for applications, the 2 Cloudlets will in fact finish in different times. In
this example, one Cloudlet will finish 1 second after the other.
WARNING: Time-shared schedulers drastically degrade performance of large scale simulations.
- Since:
- CloudSim Toolkit 1.0
- Author:
- Rodrigo N. Calheiros, Anton Beloglazov, Manoel Campos da Silva Filho
- See Also:
CloudletSchedulerCompletelyFair
,CloudletSchedulerSpaceShared
, Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description CloudletSchedulerTimeShared()
-
Method Summary
Modifier and Type Method Description protected boolean
canExecuteCloudletInternal(CloudletExecution cloudlet)
This time-shared scheduler shares the CPU time between all executing cloudlets, giving the same CPU time-slice for each Cloudlet to execute.double
cloudletResume(Cloudlet cloudlet)
Resumes execution of a paused cloudlet.java.util.List<CloudletExecution>
getCloudletWaitingList()
Gets a read-only List of cloudlet waiting to be executed on the VM.Methods inherited from class org.cloudbus.cloudsim.schedulers.cloudlet.CloudletSchedulerAbstract
addCloudletToExecList, addCloudletToReturnedList, addCloudletToWaitingList, addWaitingCloudletToExecList, clear, cloudletCancel, cloudletEstimatedFinishTime, cloudletFail, cloudletFinish, cloudletPause, cloudletReady, cloudletSubmit, cloudletSubmit, cloudletSubmitInternal, deallocatePesFromVm, findCloudletInAllLists, findCloudletInList, findSuitableWaitingCloudlet, getAllocatedMipsForCloudlet, getAvailableMipsByPe, getCloudletExecList, getCloudletFailedList, getCloudletFinishedList, getCloudletList, getCloudletPausedList, getCloudletReturnedList, getCurrentMipsShare, getCurrentRequestedBwPercentUtilization, getCurrentRequestedRamPercentUtilization, getFreePes, getPreviousTime, getRequestedCpuPercentUtilization, getRequestedMipsForCloudlet, getTaskScheduler, getUsedPes, getVm, hasFinishedCloudlets, isEmpty, isThereEnoughFreePesForCloudlet, isThereTaskScheduler, moveNextCloudletsFromWaitingToExecList, removeCloudletFromExecList, setCurrentMipsShare, setPreviousTime, setTaskScheduler, setVm, sortCloudletWaitingList, timeSpan, updateCloudletProcessing, updateProcessing
-
Constructor Details
-
CloudletSchedulerTimeShared
public CloudletSchedulerTimeShared()
-
-
Method Details
-
getCloudletWaitingList
Gets a read-only List of cloudlet waiting to be executed on the VM.For this scheduler, this list is always empty, once the VM PEs are shared across all Cloudlets running inside a VM. Each Cloudlet has the opportunity to use the PEs for a given time-slice.
- Specified by:
getCloudletWaitingList
in interfaceCloudletScheduler
- Overrides:
getCloudletWaitingList
in classCloudletSchedulerAbstract
- Returns:
- the cloudlet waiting list
-
cloudletResume
Description copied from interface:CloudletScheduler
Resumes execution of a paused cloudlet.- Parameters:
cloudlet
- the cloudlet being resumed- Returns:
- expected finish time of the cloudlet, 0.0 if queued or not found in the paused list
-
canExecuteCloudletInternal
This time-shared scheduler shares the CPU time between all executing cloudlets, giving the same CPU time-slice for each Cloudlet to execute. It always allow any submitted Cloudlets to be immediately added to the execution list. By this way, it doesn't matter what Cloudlet is being submitted, since it will always include it in the execution list.- Specified by:
canExecuteCloudletInternal
in classCloudletSchedulerAbstract
- Parameters:
cloudlet
- the Cloudlet that will be added to the execution list.- Returns:
- always true to indicate that any submitted Cloudlet can be immediately added to the execution list
- See Also:
CloudletSchedulerAbstract.canExecuteCloudlet(CloudletExecution)
-