Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CSC364 Lecture 13

Avatar for Javier Gonzalez-Sanchez Javier Gonzalez-Sanchez PRO
February 26, 2026
210

CSC364 Lecture 13

Introduction to Networked, Distributed, and Parallel Computing
Pipeline
(202607)

Avatar for Javier Gonzalez-Sanchez

Javier Gonzalez-Sanchez PRO

February 26, 2026

Transcript

  1. CSC 364 Introduction to Networked, Distributed, and Parallel Computing Lecture

    13. Pipeline Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.info ffi o ce: 14 -227 1
  2. De inition • Work lows through st ges (thre ds),

    typic lly connected by blocking queues. a a a a f f 3 a • E ch st ge runs concurrently.
  3. • A Condition object represents st te predic te th

    t thre ds c n w it for while holding lock. • E ch Condition is tied to one speci ic lock When thre d c lls w it(): • It rele ses the lock • It goes to sleep a a a a a f a a a a a a a a a a a a 4 a When sign led: • It re- cquires the lock • Execution resumes fter w it() a a Class Condition
  4. De inition A BlockingQueue is thre d-s fe queue th

    t utom tic lly h ndles: • Mutu l exclusion • W iting when empty a a a a a a a a a a a 28 f • W iting when full
  5. De inition It removes the need to m nu lly

    write: a a 29 f lock.lock(); while(condition) { await(); } ... signal(); lock.unlock();
  6. Methods put(E e) • Inserts n element • If the

    queue is full → the thre d blocks until sp ce is v il ble t ke() a a a a a a a a a a a a a 30 a • Removes nd returns the he d • If the queue is empty → the thre d blocks until n element is v il ble
  7. Solution No busy w iting. No m nu l condition

    v ri bles. No m nu l sign l. It directly solves the Producer–Consumer problem. a a a a a a a 31 a It helps with Pipeline connection
  8. CSC 364 Introduction to Introduction to Networked, Distributed, and Parallel

    Computing Javier Gonzalez-Sanchez, Ph.D. [email protected] Winter 2026 Copyright. These slides can only be used as study material for the class CSC 364 at Cal Poly. They cannot be distributed or used for another purpose. 35