The Process Management In Unix

Print   

02 Nov 2017

Disclaimer:
This essay has been written and submitted by students and is not an example of our work. Please click this link to view samples of our professional work witten by our professional essay writers. Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of EssayCompany.

A process is usually defined as the instance of the running program. Process management is an integral part of any modern day operating system (OS). Process management describes how the operating systems manage the multiple processes running at a particular instance of time.

The OS must allocate resources to processes, enable processes to share and exchange information, protect the resources of each process from other processes and enable synchronization among processes. To meet these requirements, the OS must maintain a data structure for each process, which describes the state and resource ownership of that process, and which enables the OS to exert control over each process.

Multiprogramming systems explicitly allow multiple processes to exist at any given time, where only one is using the CPU at any given moment, while the remaining processes are performing I/O or are waiting.

The process manager is of the four major parts of the operating system. It implements the process abstraction. It does this by creating a model for the way the process uses CPU and any system resources. Much of the complexity of the operating system stems from the need for multiple processes to share the hardware at the same time. As a consequence of this goal, the process manager implements CPU sharing (called scheduling), process synchronization mechanisms, and a deadlock strategy. In addition, the process manager implements part of the operating system's protection and security.

Windows 7 has evolved greatly from its predecessors, such as Windows XP. It is now a preemptive multitasking operating system. According to Wikipedia (2013) UNIX is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs. Both operating systems provide complete isolation between simultaneous users. There are some key differences in process management between the two which we will discuss in this paper.

2.0 Process Management In UNIX.

When we log on to a computer running UNIX, a shell or GUI process is started to service our commands. The UNIX operating system keeps track of the users and their processes and prevents processes from interfering with one another. The operating system does not come with any default interface for user interaction. However, the shell process on the computer running UNIX can connect to other computers to load third-party UIs.

Each process runs a single program and initially has a single thread of control. In other words, it has one program counter, which keeps track of the next instruction to be executed. Most versions of UNIX allow a process to create additional threads once it starts executing.

Figure 1 :

Several processes can run at the same time and must all be handled by the operating system. The kernel needs to maintain data for each process it is running. The data tells the OS in what state the process is, what les are open, which user is running it, etc. The information is maintained in a process structure is also called Process Control Block (PCB).

UNIX uses two categories of processes: system processes and user processes. System processes run in kernel mode and execute operating system code to perform administrative and housekeeping functions, such as allocation of memory and process swapping. User processes operate in user mode to execute user programs and utilities and in kernel mode to execute instructions that belong to the kernel. A user process enters kernel mode by issuing a system call, when an exception (fault) is generated, or when an interrupt occurs.

Process Creation in UNIX is made by means of the kernel system call, fork( ), aims to take advantage of these child process to complete specific subtasks (or delivered). When a process issues a fork request, the operating system performs the following functions:

It allocates a slot in the process table for the new process.

It assigns a unique process ID to the child process.

It makes a copy of the process image of the parent, with the exception of any shared memory.

It increments counters for any files owned by the parent, to reflect that an additional process now also owns those files.-14-

It assigns the child process to the Ready to Run state.

It returns the ID number of the child to the parent process, and a 0 value to the child process.

All of this work is accomplished in kernel mode in the parent process. When the kernel has completed these functions it can do one of the following, as part of the dispatcher routine:

Stay in the parent process. Control returns to user mode at the point of the fork call of the parent.

Transfer control to the child process. The child process begins executing at the same point in the code as the parent, namely at the return from the fork call.

Transfer control to another process. Both parent and child are left in the Ready to Run state.

It is perhaps difficult to visualize this method of process creation because both parent and

child are executing the same passage of code. The difference is this: when the return from the

fork occurs, the return parameter is tested. If the value is zero, then this is the child process, and a branch can be executed to the appropriate user program to continue execution. If the value is nonzero, then this is the parent process, and the main line of execution can continue.

Figure X UNIX Process State Transition Diagram

UNIX is a multiprogramming system, so multiple, independent processes may be running at the same time. Each user may have several active processes at once, so on a large system, there may be hundreds or even thousands of processes running.

Multitasking. UNIX is a multiprocessing, multiuser system. At any given point, you can have many processes running on UNIX. Consequently, UNIX is very efficient at creating processes. Unix has preemptive multitasking, in which time slices are allocated by a scheduler which routinely interrupts or pre-empts the running process in order to hand control to the next one. Almost all modern operating systems support preemption.

Multithreading. Most new UNIX kernels are multithreaded to take advantage of symmetric multiprocessing (SMP) computers. Initially, UNIX did not expose threads to programmers. However, POSIX has user-programmable threads. There is a POSIX standard for threads (called Pthreads) that all current versions of UNIX support.

Process hierarchy. When a UNIX-based application creates a new process, the new process becomes a child of the process that created it. This process hierarchy is often important, and there are system calls for manipulating child processes. Two processes are unique in UNIX. Process 0 is a special process that is created when the system boots; in effect, it is predefined as a data structure loaded at boot time. It is the swapper process. In addition, process 0 spawns process 1, referred to as the init process; all other processes in the system have process 1 as an ancestor. When a new interactive user logs onto the system, it is process 1 that creates a user process for that user. Subsequently, the user process can create child processes in a branching tree, so that any particular application can consist of a number of related processes.

3.0 Process Management In Windows 7

Windows 7 has evolved greatly from its predecessors, such as Windows XP. It is now a preemptive multitasking operating system. As a result, Windows relies more heavily on threads than processes. (A thread is a construct that enables parallel processing within a single process.) Creating a new process is a relatively expensive operation while creating a new thread is not as expensive in terms of system resources like memory and time. Hence, multiprocess-oriented applications on UNIX typically translate to multithreaded applications on the Windows platform, thus saving such system resources as memory and time.

When a user logs on interactively to a computer running Windows 7, the Win32 subsystem’s Graphical Identification and Authentication dynamic-link library (GINA) creates the initial process for that user, which is known as the user desktop, where all user interaction or activity takes place. The desktop on the user's computer is loaded from the server. Only the user who is logged on has access to the desktop. Other users are not allowed to log on to that computer at the same time. However, if a user employs Terminal Services or Citrix, Windows 7 can operate in a server-centric mode just as UNIX does.

The Windows 7 operating system supports multiple users simultaneously through the command line and a GUI. The latter requires the use of Windows 7 Terminal Services. Windows 7 comes with a "single user" version that allows one user at a time (Windows 7) as well as a multiuser server version (Windows 7 Server). It is rare for a Windows 7 Server system to have multiple simultaneous command-line users.

In Windows 7, creating a new thread is very efficient. Windows 7 applications are capable of using threads to take advantage of SMP computers and to maintain interactive capabilities when some threads take a long time to execute.

Unlike UNIX, Windows 7 processes do not share a hierarchical relationship. The creating process receives the process handle and ID of the process it created, so a hierarchical relationship can be maintained or simulated if required by the application. However, the operating system treats all processes like they belong to the same generation. Windows 7 provides a feature called Job Objects, which allows disparate processes to be grouped together and adhere to one set of rules.

Every process in windows 7 contains one or more threads, and the Windows 7 thread is the basic executable unit. Threads are scheduled on the basis of the usual factors: availability of resources such as CPUs and physical memory, priority, fairness, and so on. Windows has long supported multiprocessor systems, so threads can be allocated to separate processors within a computer.

Each Windows 7 process includes resources such as the following components:

One or more threads.

A virtual address space that is distinct from other processes' address spaces. Note that shared memory-mapped files share physical memory, but the sharing processes will probably use different virtual addresses to access the mapped file.

One or more code segments, including code in DLLs.

One or more data segments containing global variables.

Environment strings with environment variable information, such as the current search path.

The process heap.

Resources such as open handles and other heaps.

Each thread in a process shares code, global variables, environment strings, and resources. Each thread is independently scheduled, and a thread has the following elements:

A stack for procedure calls, interrupts, exception handlers, and automatic storage.

Thread Local Storage (TLS)—An array like collection of pointers giving each thread the ability to allocate storage to create its own unique data environment.

An argument on the stack, from the creating thread, which is usually unique for each thread.

A context structure, maintained by the kernel, with machine register values.

Figure below shows a process with several threads. This figure is schematic and does not indicate actual memory addresses, nor is it drawn to scale.

A Process in Windows 7 and Its Threads

4.0 Critical Comparison Of Process Management In UNIX And Windows 7

Both UNIX and Windows 7 OS’s are multitasking systems that support both processes and threads. They can be compared in several respects with regards to their process management features;

One key difference between UNIX and Windows 7 is the implementation of multiple users on one computer. When a user logs onto a UNIX system, a shell process is started to service their commands. Keeping track of users and their processes, a UNIX operating system is able to keep track of processes and prevent them from interfering with each other. This is extremely beneficial when all the processes run on the server, which demands a greater use of resources - especially with numerous users and sizeable applications.

Another main difference between UNIX and Windows 7 is the process hierarchy which UNIX possesses. When a new process is created by a UNIX application, it becomes a child of the process that created it. This hierarchy is very important, so there are system calls for influencing child processes. Windows 7 processes on the other hand do not share a hierarchical relationship. Receiving the process handle and ID of the process it created, the creating process of a Windows 7 system can maintain or simulate a hierarchical relationship if it is needed. The Windows 7 operating system ordinarily treats all processes as belonging to the same generation.

UNIX uses daemons, Windows 7 has service processes. Daemons are processes that are started when UNIX boots up that provide services to other applications. Daemons typically do not interact with users. A Windows 7 service is the equivalent to a UNIX daemon. When a Windows 7 system is booted, a service may be started. This is a long running application that does not interact with users, so they do not have a user interface. Services continue running during a logon session and they are controlled by the Windows 7 Service Control Manager.

OS / PROCESS

UNIX

WINDOWS 7

Multitasking

Very efficient at creating processes

Relies more on threads as opposed to processes

Multiple Users

Creates a shell process to service user commands.

Creates an initial process for a user known as the desktop.

Supports multiple simultaneous users through the command line and GUI.

Allows only one user to be logged in at a time.

Provides complete isolation between user processes.

Provides complete isolation between user processes.

Multithreading

Most UNIX kernels are multithreaded to make use of symmetric multiprocessing (SMP) computers.

Windows 7 applications are capable of using SMP computers.

Process Hierarchy

When a UNIX application creates a new process, the new process becomes a child of the parent process.

Windows 7 processes do not have a hierarchical relationship and all processes are treated equally

Table 1: Summary of Critical Comparison Of Process Management In UNIX And Windows 7

5.0 Conclusion

For each user, Unix in general, and especially Sun's Solaris provides many more utilities for manipulating files and data than Windows 7 does. For a corporate environment, Unix ( especially Solaris ) provides much more control for the administrator than Windows 7 does. Solaris, for example, enables the administrator to mirror or stripe data across several disks to minimize risk or optimize performance without 3rd party products.

Multitasking operating systems such as Windows 7 and UNIX must manage and control many processes simultaneously. Both Windows 7 and UNIX operating systems support processes and threads. Unix is much better at handling multiple tasks for a single user or for multiple users than Windows 7.

The conclusion, the best way to choose between UNIX and Windows 7 is to determine organizational needs. If an organization uses mostly Microsoft products, such as Access, Front Page, or VBScripts, it's probably better to stick with Windows 7. But, if reliability, universal compatibility, and stability are a concern, UNIX would probably be the way to go. For a programmer or for an administrator, Unix provides more power and flexibility than Windows 7. For the less sophisticated user, Windows 7 can often more easily be installed and configured to run on cheaper hardware to run a desired 3rd party product. In short -- Unix is better, Windows 7 is easier for less sophisticated users.

UNIX has a novel approach to designing software. Since UNIX is open-sourced, it attracts some very intelligent programmers who develop many applications free of charge. With this in mind, many designers choose to resolve software problems by creating simpler tools that interconnect rather than creating large application programs. In contrast, Windows 7 applications are all proprietary and costly. With UNIX, each generation extends, rather than replaces the previous like Windows 7 it is rarely necessary to upgrade - old and new Unix are all compatible. The main reason for this is the way UNIX is built, which is on a solid theoretical foundation. There are many advantages to this, for instance, a book written 20 years ago that discusses programming UNIX can still be used today. Imagine trying to figure out how to run Windows 7 XP with a Window 3.1 manual - it can't be done.



rev

Our Service Portfolio

jb

Want To Place An Order Quickly?

Then shoot us a message on Whatsapp, WeChat or Gmail. We are available 24/7 to assist you.

whatsapp

Do not panic, you are at the right place

jb

Visit Our essay writting help page to get all the details and guidence on availing our assiatance service.

Get 20% Discount, Now
£19 £14/ Per Page
14 days delivery time

Our writting assistance service is undoubtedly one of the most affordable writting assistance services and we have highly qualified professionls to help you with your work. So what are you waiting for, click below to order now.

Get An Instant Quote

ORDER TODAY!

Our experts are ready to assist you, call us to get a free quote or order now to get succeed in your academics writing.

Get a Free Quote Order Now