Margaret Rouse is an award-winning technical writer and teacher known for her ability to explain complex technical subjects simply to a non-technical, business audience. Over…
First Come, First Served (FCFS) is a type of scheduling algorithm used by operating systems and networks to efficiently and automatically execute queued tasks, processes and requests by the order of their arrival. An FCFS scheduling algorithm may also be referred to as a first-in, first-out (FIFO) algorithm or a first-come, first-choice (FCFC) algorithm.
Due to its simplistic nature, an FCFS algorithm is predictable, regardless of the type of tasks or requests it has to process. Like a grocery store checkout scheme, FCFS algorithms mimic real-life customer service situations where patrons who arrive first get served first regardless of the size and complexity of their interaction.
First Come, First Served is one of the most efficient and autonomous types of scheduling algorithm because it requires little-to-no human or artificial intelligence (AI) intervention and does not waste time prioritizing tasks and requests by their urgency or level of complexity. Additionally, the party responsible for the scheduling is the CPU itself instead of software or an alternate, more complex job scheduling algorithm.
FCFS is an easy-to-setup and implement algorithm that does not prioritize tasks and requests by estimating how much time it will take to complete a task. While this allows it to be efficient and quick in systems that handle multiple tasks of similar nature that demand near-identical time and computational power, it does not perform as well when it comes to complex systems that need to handle a wide variety of requests at the same time.
Use of the FCFS algorithm risks the possibility that a series of simple requests will get stuck in a central processing unit's queue for an unreasonably long wait time behind a single complex task — just because the complex task arrived first.
Here is how an FCFS scheduling algorithm works. To begin, suppose there are three requests to process in the CPU’s queue: P1, P2, and P3. Assume P1 is a complex process that requires approximately 25 seconds, P2 a much simpler request that requires only 10 seconds of processing, and P3 a moderately simple request that requires 15 seconds.
When P1 is first put in the queue, the wait time is zero and the CPU starts the processing immediately. P2, on the other hand, would have a wait time of 25 seconds. And P3, having arrived last, would have to wait 35 seconds. As a total, an FCFS scheduling algorithm would need 50 seconds to complete all three requests and empty the queue, which would be the same as other sequential processing, mono-CPU systems.
Because FCFS does not evaluate requests before starting, it has fewer complete tasks per set period of time when compared to an intelligent scheduling algorithm. In this scenario, the FCFS scheduling algorithm would complete a single task in the first half of its run time of 25 seconds. Other algorithms—that start from the simplest of requests, for example—would have finished two requests.
The scenario aforementioned is an example of the Convoy Effect in operating systems. In this context, the word ‘Convoy’ refers to a real-world situation in which a group of vehicles travel together and one unit. If one vehicle in the convoy gets stuck behind a much slower vehicle, the result is that the rest of the convoy will slow down. (Note: This analogy is only true in sequential processing when there is not an alternative processing unit to take a part of the load off of the primary processing unit.)
Despite the various downsides of using an FCFS scheduling algorithm, it has many use cases where intelligent scheduling algorithms end up wasting more time re-evaluating the priority of each request after it finishes processing the previous one.
Techopedia’s editorial policy is centered on delivering thoroughly researched, accurate, and unbiased content. We uphold strict sourcing standards, and each page undergoes diligent review by our team of top technology experts and seasoned editors. This process ensures the integrity, relevance, and value of our content for our readers.
Margaret is an award-winning technical writer and teacher known for her ability to explain complex technical subjects to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles by the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret's idea of a fun day is helping IT and business professionals learn to speak each other’s highly specialized languages.
What Is Hyperdimensional Computing? Hyperdimensional computing is a new approach to information processing that uses high-dimensional mathematical vectors to represent...
Margaret RouseTechnology Expert
What Does STEM Mean?STEM is an integrated, interdisciplinary, and student-centered approach to learning that encourages critical thinking, creativity, collaboration and...
What Does Distributed Cloud Mean?Distributed cloud is a business model that extends a public cloud provider’s infrastructure and services to...
Trending NewsLatest GuidesReviewsTerm of the Day