Sometimes the terms user, job, and process are used interchangeably. Define each
ID: 3832305 • Letter: S
Question
Sometimes the terms user, job, and process are used interchangeably. Define each of the terms. In what circumstances do these terms have similar meanings? Explain the difference between mutual exclusion and semaphores. What is the name of the situation when processes wait on each other and cannot continue. List four necessary conditions for this situation to occur. What is the name of the technique in which the processes in memory are re-organized to free contiguous memory? Write a program that creates two independent processes of execution that send each other string "Hello"Explanation / Answer
process is a state/program in execution.It represents the basic unit of work to be implemented in the system.
where as Job represents any task or work. A job is an overall unit of work, and is composed of tasks.
A "job" often means a set of processes.when a job has only 1 process to be performed then both the words will be considered as same meanings.
2.
In multiprogramming operating system,distributed system,we come across these two words.
Definitions of both:
Mutual Exclusion:
A mutual exclusion (mutex) is a program object that prevents simultaneous access to a shared resource. This concept is used in concurrent programming with a critical section, a piece of code in which processes or threads access a shared resource.
Semaphore:
A semaphore, in its most basic form, is a protected integer variable that can facilitate and restrict access to shared resources in a multi-processing environment. The two most common kinds of semaphores are counting semaphores and binary semaphores.
consider multithreaded profgram.
Semaphores is used when a process say athread will we have to check and then change.
Mutex is used when awe have scope of allowing threads to share the same resource, [Ex:file access] but not simultaneously.
3.
The situation is called deadloack,where one process waits for another process to complete,at the same time the another process waits for the first process to complete.
Four consitions for deadlock are:
1.Mutex:mutual exclusion:we have sahring so deadlock may occur.
The resources involved are non-shareable.
2.Hold and Wait Condition
Requesting process hold already, resources while waiting for requested resources.
3.No-Preemptive Condition
Resources already allocated to a process cannot be preempted.
4.Circular Wait Condition
The processes in the system form a circular list or chain where each process in the list is waiting for a resource held by the next process in the list.
When any of these conditions re met deadlock will occur.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.