I'm fairly confused with some of the terms used in Linux when I learn about web backend programming.
Job is work that needs to be done. A task is a piece of work that needs to be done. The process is a series of actions that is done for a particular purpose. Job and task define the work to be done, whereas process defines the way the work can be done or how the work should be done.
The difference between a thread and a process is, when the CPU switches from one process to another the current information needs to be saved in Process Descriptor and load the information of a new process. Switching from one thread to another is simple. A task is simply a set of instructions loaded into the memory.
Process means a program is in execution, whereas thread means a segment of a process. A Process is not Lightweight, whereas Threads are Lightweight. A Process takes more time to terminate, and the thread takes less time to terminate. Process takes more time for creation, whereas Thread takes less time for creation.
Answer: A process refers to a program under execution. This program may be an application or system program. Job means an application program and it is not a system program.
The distinction between process and thread is fairly universal to all operating systems. A process usually represents an independent execution unit with its own memory area, system resources and scheduling slot.
A thread is typically a "division" within the process - threads usually share the same memory and operating system resources, and share the time allocated to that process. For example, when you open your Browser and Microsoft Word, each is a different process, but things that happen in the background of each (like animations, refreshes or backups) can be threads.
A job is usually a long-running unit of work executed by a user. The job may be "handled" by one or more processes. It might not be interactive. For instance, instructing the machine to zip a large file or to run some processing script on a large input file would typically be a job. The naming is relatively historic - Mainframes used to process jobs. In UNIX systems, many jobs are started automatically at prescheduled times using cron, so you have the notion of 'cron jobs'.
So, a process is a single program. It has at least one thread, maybe more. Each thread takes one scheduler slot, but schedulers differ in how they allocate CPU to threads; in any case, the point of threads is to let a process do multiple things in parallel. Threads share system resources of various kinds, especially memory, files and sockets.
Jobs and tasks are unix shell concepts; a job is a process that a shell launched that is still running, either paused or running in the background. There is a long section on 'job control' in the bash
manual. Job and task are roughly equivalent concepts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With