Senin, 18 Maret 2013



Algorithm First Come First Served

Algorithm First Come First Served (FCFS) is also called as the first technique Arriving First Served (PTPD). FCFS is no priority scheduling and without preempsi (see post cpu scheduling). Therefore, this process consists in the queue simultaneously pure.

In FCFS, a process that arrives first will be served first. When it arrives at the same time, the services performed by the order they are in the queue. It does not matter whether they are short or a long process. To be able to be serviced by the processor, process the queue behind must wait until all processes carried out in front of it completed.


  Name of the   process Arrival Old process
A
B
C
D
E
0
0
0
0
0
7
10
2
4
8

Picture Case DI - five queues with arrival process = 0

Name of the   process Arrival Old process
A
B
C
D
E
0
1
8
2
5
7
10
2
4
8

Picture Case II - queue five different arrival processes

We can directly incorporate this process into the process table on the processor. In case I, the B can only be implemented after a completed process implemented. Process C can only be implemented after the completion B implemented. And so on to obtain the values ​​as shown in the table following Figure.


Name of the   process Arrival Old Process Time Start Time Complete Time
Vain
Older Response
A
B
C
D
E
0
0
0
0
0
7
10
2
4
8
0
7
17
19
23
7
17
19
23
31
0
7
17
19
23
7
17
19
23
31




Number
Mean
66
13,2
97
19,4

Performance image processor with the FCFS algorithm for the case I

It appears here that the average response time was 19.4 units of time. This value is quite large compared to the long process of each process. Here's an illustration for an example of the second case.


Name of the   process Arrival Old Process Time Start Time Complete Time
Vain
Older Response
A
B
D
E
C
0
1
2
5
8
7
10
4
8
2
0
7
17
21
29
7
17
21
29
31
0
6
15
16
21
7
16
19
24
23




Number
Mean
58
11,6
89
17,8
   
 Performance image processor with the FCFS algorithm for the case II

In Figure Case at the top of this post, the process has not ordered according to arrival time, so after ordered by time of arrival, the queue to be A, B, D, E, and C. It appears here that the average response time was 17.8 units of time. This value is quite large compared to the long process of each process but still smaller than the average response time for case I. The difference with the first example lies in the calculation of response time. If in the first instance, the same old response when finished, so here they are not the same as when it is not the same process.

These two examples show that the response time is strongly influenced by the long process of the process located at the front of the queue. If the old process to the process at the front of the queue was huge, then the long process with a short process on the back of the queue, still have a long wait before they can be serviced by the processor. That's why FCFS scheduling is less profitable for the entire service.

One way to overcome this is through a priority. Long process with a short process the priority precedence to the processor. Shortened period of the process, the sooner the process is serviced by the processor. Scheduling is known as the Shortest Process Prior.
 


1 komentar: