13-Concurrent_Programming_I

13-Concurrent_Programming_I - CSC 4304 - Systems...

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

View Full Document Right Arrow Icon
1 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
Background image of page 1

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

View Full DocumentRight 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? 7
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

13-Concurrent_Programming_I - CSC 4304 - Systems...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online