18 ConcurrentProg - Concurrent Programming Scott, Chapter...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Concurrent Programming Scott, Chapter 12 So far, mostly sequential programs have single active execution context Sequentiality is fundamental in imperative programming (we modify the store in a particular order) implicit in functional and logic programming not required by the paradigm f(g(x), h(y)) logic programming = searching and/or tree practical functional and logic languages often have partially sequential semantics (pattern matching order in ML and Prolog) Concurrent programs: contain more than one active execution context an active execution context (Scott) or unit of execution (Mattson, Sanders, Massingill) is a thread or process thread or process can be thought of as an abstraction of a processor threads usually lightweight, share address space but have own stack processes usually heavyweight, own address space terminology not consistent in concurrent programming Processes/Threads can come from multiple CPUs kernel-level multiplexing of single physical machine language or library level multiplexing of kernel-level abstraction They can run in true parallel unpredictably interleaved run-until-block Most work focuses on the first two cases, which are equally difficult to deal with Reasons for concurrency To capture the logical structure of the program servers and graphical application keep track of multiple tasks at the same time. It is convenient to associate each task with a thread of control Activities in a web browser or GUI To cope with independent physical devices an OS may be interrupted by a physical device at almost any time. It is convenient to have one context for the interrupted task, and one context to handle the interrupt systems for real-time control may contain many physical processors message routing software for the internet is a large concurrent program To increase performance by utilizing multiple processors (parallel programming) Some history early computers were single user first motivation for concurrency/parallelism came from coping with devices - busy waiting for devices wasted very expensive cycles context-switching between (batch) users allowed cycles to be used for somebody else while current application waited: this is concurrency/multiprogramming introduction of programmable I/O (e.g. IBM channels) led to possibility of RACE CONDITIONS in accessing of memory by processor and device: this is parallelism in a restricted form design of operating systems that could handle asynchronous I/O interrupts led to possibility of race conditions in accessing memory locations from normal code and interrupt handlers (Mid 1960s) history, continued introduction of interprocess communication in timesharing systems led to quasi-parallel user programs (concurrent and logically parallel but not physically parallel) (Early 1970s) networks led to truly parallel distributed programs...
View Full Document

Page1 / 90

18 ConcurrentProg - Concurrent Programming Scott, Chapter...

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

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