transp-processes1 - Processes and Concurrent Process...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Processes and Concurrent Process Control Processes, and their variant, threads, are the most essential elements in a computer system under the control of the operating system. Proper management of processes is critical in the correct functioning and efficient operation of the system. A process is a program in execution. It is created when a program’s execution is requested and initiated. Once created, a process goes through a number of states throughout its existence until it terminates. The following diagram depicts typical state transitions of a process. A sequential process is a process with a single thread of control regulating its execution. Concurrent processes refer to simultaneous interacting sequential processes. Concurrent processes are asynchronous, each with its own address space. Between two processes, some components are disjoint and can be executed concurrently while other components require communication and synchronization. A process may spawn new processes, resulting in multiple threads of execution. A particular implementation that supports this capability groups a process and the subprocesses it spawns together to share a common address space, but each has its own local state. Theses processes are referred to as light-weight processes, or threads. Multi-threaded processes present another level of concurrency in the system. Thread management functions may be implemented as a software layer in the user space. They may also be implemented at the kernel level. When two processes (or threads) access a shared variable concurrently, a race condition occurs. Examples of race condition: 1. Two threads need to access variable count as follows: Observer: do forever Reporter: do forever Observe an event; print count; count := count + 1; count := 0; end end Suspended- blocked Running Blocked Ready Nonexistent Suspended- ready Signal Suspend Schedule Schedule Signal Create Delete Resume Delete Suspend Wait Delete Delete Resume Suspend Signal
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2. Two threads need to update the queue below as follows: E-process: Insert element E into the queue by F-process: Insert element F into the queue by E^.next := first; F^.next := first; first := E; first := F; As these examples illustrate, race condition could easily lead to erroneous results in the shared variables if (i) there are concurrent access to them to change their content; and (ii) the concurrent access is not properly controlled. The code segment that accesses the shared variable is referred to as a critical section (CS).
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern