13-Concurrent_Programming_I - CSC 4304 Systems Programming...

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

View Full Document Right Arrow Icon
CSC 4304 - Systems Programming Fall 2010 Tevfik Ko ! ar Louisiana State University October 28th, 2010 Lecture - XIII Concurrent Programming - I 2 Roadmap Sequential vs Concurrent Programming Shared Memory vs Message Passing Divide and Compute Threads vs Processes POSIX Threads 3 Concurrent Programming So far, we have focused on sequential programming : all computational tasks are executed in sequence, one after the other. Today, we will start learning concurrent programming: multiple computational tasks are executed simultaneously, at the same time. 1 1 2 3 2 4 5 3 4 5 sequential concurrent 4 Concurrent Programming Implementation of concurrent tasks: as separate programs as a set of processes or threads created by a single program Execution of concurrent tasks: on a single processor ! Multithreaded programming on several processors in close proximity ! Parallel computing on several processors distributed across a network ! Distributed computing 5 Why Threads? In certain cases, a single application may need to run several tasks at the same time Creating a new process for each task is time consuming Use a single process with multiple threads • faster less overhead for creation, switching, and termination share the same address space 6 Motivation Increase the performance by running more than one tasks at a time. divide the program to n smaller pieces, and run it n times faster using n processors To cope with independent physical devices. do not wait for a blocked device, perform other operations at the background
Image of page 1

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

View Full Document Right Arrow Icon
Serial vs Parallel 7 Q Please COUNTER COUNTER 1 COUNTER 2 8 Divide and Compute x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 How many operations with sequential programming?
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