TAILIEUCHUNG - Lecture Programming languages (2/e): Chapter 17 - Tucker, Noonan

Chapter 17 - Concurrent programming. This chapter illustrates each of these scenarios, along with the coordination and data shming strategies that underlie their effective implementation. To provide a focus for this discussion, our examples favor Java as the language of illustration. Concurrency features in several other languages are summalized at the end of the chapter. | Programming Languages 2nd edition Tucker and Noonan Chapter 17 Concurrent Programming Two roads diverged in a yellow wood, And sorry I could not travel both . Robert Frost, The Road Not Taken Contents Concurrency Concepts Synchronization Strategies Synchronization in Java Interprocess Communication Concurrency in Other Languages Concurrency occurs at many levels More realistic Can be more efficient Carries unique, fundamental complexities Traditionally studied in the context of operating systems Example: client-server application such as web browsing Concurrency Concepts Example: web browser rendering a page Page is a shared resource Thread for each image load Thread for text rendering Cannot all write to page simultaneously Thread for user input; ., Stop button Multiprogramming: several programs loaded into memory and executed in an interleaved manner Scheduler: switches from one program or thread to another Time-sharing: allow multiple users to communicate with a computer simultaneously Process: an execution context, including registers, activation stack, next instruction to be executed, etc. Defn: A concurrent program is a program designed to have two or more execution contexts. Such a program is said to be multithreaded, since more than one execution context can be active simultaneously. Parallel program: 2 or more threads simultaneously active. Distributed program: designed so that different pieces are on computers connected by a network. Concurrency: a program with multiple, active threads. Single threaded: all earlier programs. States of a thread: Created: but not yet ready to run Runnable: ready to run; awaiting a processor Running: executing Blocked: waiting on some resource Terminated: stopped States of a Thread Figure Inter-thread communication needs to occur: Thread requires exclusive access to some resource Thread needs to exchange data with another thread Can communicate via: Shared variables Message passing .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.