Operating systems and processes
Right now, your device may be doing many things at once. Your browser may have several tabs open, music may be playing, messages may be arriving, and files may be downloading in the background.
All these applications need access to the same computer resources: processing power, memory, storage, the screen, the keyboard, and the network connection.
Something needs to coordinate that activity, and that responsibility belongs to the operating systemConcept · lights on your mapoperating systemThe foundational software that manages a computer’s hardware and provides an environment in which applications can run. It divides CPU time and memory among running programs, controls access to storage and the network, and gives every application a standard, simplified way to use the hardware..
What is an operating system?
An operating system, often shortened to OS, is the foundational software that manages a computer’s hardware and provides an environment in which applications can run.
Common operating systems include:
- Microsoft Windows
- Apple macOS
- Linux
- Android
- Apple iOS
Windows and macOS manage laptops and desktop computers, while Android and iOS perform the same general role for phones and tablets.
The operating system sits between applications and much of the computer’s underlying hardware. Instead of every application independently figuring out how to use the processor, memory, storage, screen, or speakers, it relies on services provided by the operating system.
This is another example of abstraction. The operating system hides much of the hardware’s complexity behind simpler and more consistent ways for applications to use it.
How the operating system manages resources
In the first lesson of this module, the CPU was compared to a worker and RAM to the worker’s desk.
A modern computer usually has several CPU cores, which means it can perform more than one stream of work, but there are often far more tasks waiting than the CPU can handle at exactly the same instant.
So the operating system decides which work receives processing time, switching among tasks extremely quickly and helping many applications appear to run simultaneously.
The operating system also manages memory, giving running applications their own areas of it and helping prevent one application from freely reading or changing another application’s working information.
This separation matters. If a game crashes, it should not normally corrupt the spreadsheet or document open in another application.
The operating system also provides common capabilities such as:
- Saving and opening files
- Displaying windows and graphics
- Receiving keyboard and mouse input
- Playing sound
- Connecting to a network
- Communicating with printers, cameras, and other devices
Without an operating system, every application would need to manage these hardware details for itself.
Whose job is it: the operating system's, or the application's?
Why applications depend on an operating system
Applications are generally built for particular operating systems because each operating system provides its own environment, capabilities, and rules.
A desktop application made for macOS may not automatically run on Windows, and a mobile app created for iOS may need a different version to run on Android.
The applications may serve the same purpose, but their developers must make them work with the operating system beneath them.
This is why download pages sometimes ask you to choose among WindowsConcept · lights on your mapWindowsMicrosoft’s operating system, dominant in offices and on consumer PCs. One of the big three alongside macOS and Linux., macOSConcept · lights on your mapmacOSApple’s operating system for Mac computers, common among developers and designers. One of the big three alongside Windows and Linux., or LinuxConcept · lights on your mapLinuxA free and open-source operating system that runs the overwhelming majority of the world’s servers. One of the big three alongside Windows and macOS, and Android is built on it.. You are choosing a version of the application that was prepared for your operating system.
What is Linux?
Linux is an operating system that is especially common on servers, cloud infrastructure, and technical systems, and many people use Windows or macOS on their personal computers without regularly interacting with it.
But engineers encounter Linux frequently because many applications run on Linux-based machines after they are deployed to servers or the cloud.
You do not need to learn how to use Linux yet. For now, recognize it as one of the major operating-system families and as an especially common environment for running backend software.
What is a process?
A program can exist as a collection of files stored on a computer. When you launch that program, the operating system creates a running instance of it called a processConcept · lights on your mapprocessOne running instance of a program, with its own memory walled off by the OS. The program is the stored software; a process is that software actively running. One app can have several processes. Modern browsers run tabs as separate processes, so a crashed tab doesn’t take the others down..
Consider a music application installed on your laptop. While the application is closed, its files remain in storage. But when you open it, the operating system loads the necessary information into memory, gives it access to processing time, and creates a process.
A useful distinction is: a program is the stored software. A process is that software actively running.
The process has resources associated with it, including memory and access to CPU time.
Depending on the application and operating system, opening an application more than once may create multiple processes, and modern browsers commonly use several processes at the same time, separating different tabs and responsibilities.
What happens when you force quit an application?
When an application becomes unresponsive, you may choose to force quit it, which asks the operating system to stop the running process. That ends the active instance and releases many of the resources it was using.
But the application’s installed files normally remain in storage, which is why you can usually open the application again afterward.
Unsaved information may be lost because it may have existed only in the memory assigned to the process, while information already saved to storage should remain available.
What is a thread?
You may also hear engineers use the word threadRecognition — just know it existsthreadA smaller sequence of work inside a process. A process can run several threads at once, sharing many of the process’s resources. You met this word in Module 1, and now you know where threads live: inside processes., one you first met in Module 1 and can now place precisely.
A thread is a smaller sequence of work that exists inside a process, and a process can contain one or several threads performing different tasks while sharing many of the process’s resources.
For example, one thread might respond to what the user is doing while another handles work in the background.
You do not need to understand thread management at this stage. The basic relationship to remember is: a process is a running instance of a program. Threads are smaller streams of work inside that process.
Connecting the layers
You can now connect the major layers inside a computer.
The hardware provides processing power, memory, storage, and physical capabilities.
The operating system manages those resources and gives applications controlled ways to use them.
An application provides capabilities that help a user accomplish a purpose.
When an application runs, the operating system manages it as one or more processes.
Each layer builds on the one beneath it while hiding details that the layer above does not always need to understand.
The mental model to remember
An operating system is the foundational software that manages a computer’s hardware and allows applications to run.
A program is software stored on a computer.
A process is a running instance of that program.
A thread is a smaller stream of work inside a process.
The operating system distributes resources, separates running applications, and provides common services so that every application does not need to control the hardware directly.
One browser tab freezes solid, but your other tabs and apps keep working. What does that tell you about how the browser is built?
▼ answer the check to continue ▼