Scheduling Definition:

In multitasking, we said that a part of the functionality is executed one at a time. Now, the question is part means how many statements. This conflict is resolved by scheduling.

  1. Scheduling is the process in which a specific time period is allocated to functionality where the control remains in that particular functionality for that specific time period. Once the time period is elapsed, control switches to anther functionality with another time suite and so on.
  2. Scheduling is supervised by the scheduler.
  3. The time slices allocated will be in the order of nano-seconds
  4. Thus, by the time our eye recognizes the execution of one part, control switches to another part of the program

Int delay =2000; // delay for 2 second

Int period = 1000; // repeat every, one second

Timer timer = new Timer() // timer object

timer. scheduleAtFixedRate(new TimerTask){

public void run(){

// Task here….


}, delay, period

Here the above code snippet shows a timer for scheduling a task to run repeatedly. The above timer code snippet allows the particular tasks to be scheduled particularly for repeated execution; this is done by stipulating a fixed rate of the period or a fixed rate of delay between different executions.

On the other hand, there are some different many applications and methods these have more composite scheduling necessities. This can be exemplified like an alarm clock that

This can be exemplified like an alarm clock that gives a sound of a wake-up call particularly on every morning at exact time and for this the method of fixed rate schedule of 86400000 milliseconds cannot simply be used for the reason that the alarm would be very late or too early on the different days the clocks as go forward or backward.

The solution for this issue it is better to use calendar arithmetic to calculate the next scheduled occurrence of a daily event.

Scheduling Definition Homework Help