What is Concurrent Programming?

Slides:



Advertisements
Similar presentations
Threads, SMP, and Microkernels
Advertisements

Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 5: Threads Overview Multithreading Models Threading Issues Pthreads Solaris.
Chapter 11 Operating Systems
1 Chapter 4 Threads Threads: Resource ownership and execution.
Processes Part I Processes & Threads* *Referred to slides by Dr. Sanjeev Setia at George Mason University Chapter 3.
What is Concurrent Programming? Maram Bani Younes.
Operating System Overview Dr. Sunny Jeong & Mr. M.H. Park Operating Systems: Internals and Design Principles, 6/E William Stallings.
1 COMPSCI 110 Operating Systems Who - Introductions How - Policies and Administrative Details Why - Objectives and Expectations What - Our Topic: Operating.
 What is OS? What is OS?  What OS does? What OS does?  Structure of Operating System: Structure of Operating System:  Evolution of OS Evolution of.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3: Operating Systems Computer Science: An Overview Tenth Edition.
Fall 2000M.B. Ibáñez Lecture 01 Introduction What is an Operating System? The Evolution of Operating Systems Course Outline.
Processes and Threads Processes have two characteristics: – Resource ownership - process includes a virtual address space to hold the process image – Scheduling/execution.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 13 Threads Read Ch 5.1.
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
Ihr Logo Operating Systems Internals & Design Principles Fifth Edition William Stallings Chapter 2 (Part II) Operating System Overview.
Lecture 5: Threads process as a unit of scheduling and a unit of resource allocation processes vs. threads what to program with threads why use threads.
Chapter 4: Multithreaded Programming. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts What is Thread “Thread is a part of a program.
An operating system is the software that makes everything in the computer work together smoothly and efficiently. What is an Operating System?
Department of Computer Science and Software Engineering
Threads. Readings r Silberschatz et al : Chapter 4.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 4: Threads.
Page 1 2P13 Week 1. Page 2 Page 3 Page 4 Page 5.
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
1 Chapter 5: Threads Overview Multithreading Models & Issues Read Chapter 5 pages
Chapter 2 Operating System Overview Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
Lecture 5. Example for periority The average waiting time : = 41/5= 8.2.
Threads Overview Benefits, User and Kernel Threads.
Chapter 4 – Thread Concepts
Chapter 4: Threads Modified by Dr. Neerja Mhaskar for CS 3SH3.
Introduction to threads
COMPSCI 110 Operating Systems
Chapter 4: Multithreaded Programming
OPERATING SYSTEM CONCEPT AND PRACTISE
Chapter 4: Threads.
Chapter 4: Threads.
Processes and threads.
Processes and Threads Processes and their scheduling
Chapter 4 – Thread Concepts
Chapter 2 Processes and Threads Today 2.1 Processes 2.2 Threads
Chapter 5: Threads Overview Multithreading Models Threading Issues
Operating System (013022) Dr. H. Iwidat
Chapter 4: Multithreaded Programming
Lecture 21 Concurrency Introduction
Introduction to Operating System (OS)
Quick Introduction to OS
Threads & multithreading
Chapter 4: Threads.
Operating System Concepts
Chapter 1: Introduction
Chapter 4: Threads.
Threads, SMP, and Microkernels
Chapter 15, Exploring the Digital Domain
Chapter 4: Threads.
What is Concurrent Programming?
What is Concurrent Programming?
Introduction to Operating Systems
Threads Chapter 4.
Introduction to Operating Systems
Multithreaded Programming
Operating Systems (CS 340 D)
Chapter 4: Threads & Concurrency
CS510 Operating System Foundations
Chapter 2 Operating System Overview
Chapter-1 Computer is an advanced electronic device that takes raw data as an input from the user and processes it under the control of a set of instructions.
Chapter 4: Threads.
Operating System Overview
An Introduction to Operating Systems
Introduction and History
Chapter 3: Process Management
Presentation transcript:

What is Concurrent Programming? Maram Bani Younes

Ordinary Program An "ordinary" program in a programming language consists of: data declarations, assignment control-flow statements. Modern languages include structures, for organizing large software systems, such as: Procedures. Modules. These machine instructions are executed sequentially on a computer and access data stored in the main or secondary memories.

Concurrent Program A concurrent program is a set of sequential programs that can be executed in parallel. Process: the sequential programs that comprise a concurrent program Program: the set of processes. Parallel: systems in which the executions of several programs overlap in time by running them on separate processors. Concurrent: potential parallelism, in which the executions may, but need not, overlap. The parallelism may only be apparent since it may be implemented by sharing the resources of a small number of processors, often only one.

Multitasking Multitasking is a simple generalization from the concept of overlapping I/O with a computation , to overlapping the computation of one program with that of another. Multitasking is the central function of the kernel of all modern operating systems. A scheduler program is run by the operating system to determine which process should be allowed to run for the next interval of time. The scheduler can take into account: priority considerations time-slicing, Computations are interrupted to allow a fair sharing of the computational resources, in particular, of the CPU. You are intimately familiar with multitasking; it enables you to write a document on a word processor while printing another document and simultaneously downloading a file.

Multi-Threading Multitasking has become so useful that modern programming languages support it within programs by providing constructs for multithreading. Threads enable the programmer to write concurrent (conceptually parallel) computations within a single program. For example, interactive programs contain: A separate thread for handling events associated with the user interface that is run concurrently with the main thread of the computation.

The Terminology of Concurrency The term process is used in the theory of concurrency, while the term thread is commonly used in programming languages. The process runs in its own address space managed by the operating system. The thread runs within the address space of a single process and may be managed by a multithreading kernel within the process. The term thread was popularized by pthreads (POSIX threads), a specification of concurrency constructs that has been widely implemented, especially on UNIX systems.

Multiple Computers (Multi-processor) The days of one large computer serving an entire organization are long gone. Today, computers hide in unforeseen places like automobiles and cameras. In your personal "computer" (in the singular) contains more than one processor: The graphics processor: is a computer specialized for the task of taking information from the computer's memory and rendering it on the display screen. I/O and communications interfaces

Multiple Computers (Multi-processor) Multiprocessors are systems designed to bring the computing power of several processors to work in concert on a single computationally intensive problem. Multiprocessors are extensively used in scientific and engineering simulation, for example: Simulating the atmosphere for weather forecasting and studying climate. Military and surveillance services The entire Internet can be considered to be one distributed system working to disseminate information in the form of email and web pages.

The Challenge of Concurrent Programming The challenge in concurrent programming comes from the need to synchronize the execution of different processes and to enable them to communicate. Independent and dependent processes : If the processes were totally independent, the implementation of concurrency would only require a simple scheduler to allocate resources among them. If an I/O process accepts a character typed on a keyboard, it must somehow communicate it to the process running the word processor, If there are multiple windows on a display, processes must somehow synchronize access to the display so that images are sent to the window with the current focus.

Challenges It turns out to be extremely difficult to implement safe and efficient synchronization and communication. When your personal computer "freezes up“ OR When using one application causes another application to "crash“ The cause is generally an error in synchronization or communication. Since such problems are time- and situation-dependent. They are difficult to reproduce, diagnose and correct.

Conclusion We have defined concurrent programming informally, based upon your experience with computer systems. Our goal is to study concurrency abstractly, rather than a particular implementation in a specific programming language or operating system. (We Will Study It in JAVA environment). We have to carefully specify the abstraction that describe the allowable data structures and operations.

Review Sequential vs Concurrent Process vs Program Multithreading vs Multitasking Multiprocessor Challanges