1 / 11

System Level Programming Software College of SCU

System Level Programming Software College of SCU. 四川大学软件学院 舒莉. Lab 15. Concurrent Programming. The Problem of Producer and Consumer Read the code in file week15 lab_code.cpp A console program Uses Critical Section One Producer, One Consumer Buffer size is 1 Problems in it

hazel
Download Presentation

System Level Programming Software College of SCU

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. System Level ProgrammingSoftware College of SCU 四川大学软件学院 舒莉

  2. Lab 15. Concurrent Programming • The Problem of Producer and Consumer • Read the code in file • week15 lab_code.cpp • A console program • Uses Critical Section • One Producer, One Consumer • Buffer size is 1 • Problems in it • Synchronization? • Mutual Exclusion? 201001V1.1

  3. Lab 15. Concurrent Programming • The Problem of Producer and Consumer • Rewrite it, you • Can re-use parts of the code given • Port it from console to GUI • You make the decision on what to use • Four practice are provided • Practice 1 • Practice 2 • Practice 3 • Practice 4 [optional] • Practice 5 [optional] 201001V1.1

  4. Lab 15. Concurrent Programming • Practice1: • To use the Critical Section to fulfill Mutual Exclusion • One Producer, One Consumer • Buffer size is 1 201001V1.1

  5. Lab 15. Concurrent Programming • Practice2: • To use the Event Kernel Object to fulfill Synchronization (and Mutual Exclusion) (optional) • One Producer, One Consumer • Buffer size is 1 201001V1.1

  6. Lab 15. Concurrent Programming • Practice3: • To use Semaphore and Mutex fulfill Synchronization and Mutual Exclusion • One Producer, One Consumer • Buffer size is 1 201001V1.1

  7. Lab 15. Concurrent Programming • Practice4: [optional] • To use Semaphore and Mutex fulfill Synchronization and Mutual Exclusion • One Producer, One Consumer • Buffer size is 5 • Circle queue 201001V1.1

  8. Lab 15. Concurrent Programming • Practice5: [optional] • To use Semaphore and Mutex fulfill Synchronization and Mutual Exclusion • Two Producer, Two Consumer • Buffer size is 5 • Circle queue 201001V1.1

  9. Lab 15. Concurrent Programming • 本次Lab需要完成的提交:学号_姓名_week15.rar: • 文件1/2: practice1.rar • project1.rar [删除掉debug目录再压缩!] • project1.doc [概要设计文档] • 文件2/3: practice2.rar • project2.rar [删除掉debug目录再压缩!] • project2.doc [概要设计文档] • 文件3/3: practice3.rar • project3.rar [删除掉debug目录再压缩!] • project3.doc [概要设计文档] • Upload to module @week15 • Due:see it on the Moodle 201001V1.1

  10. Lab 15. Concurrent Programming • 本次Lab需要完成的提交:学号_姓名_week15.rar: • 文件1/5: practice1.rar • project1.rar [删除掉debug目录再压缩!] • project1.doc [概要设计文档] • 文件2/5: practice2.rar • project2.rar [删除掉debug目录再压缩!] • project2.doc [概要设计文档] • 文件3/5: practice3.rar • project3.rar [删除掉debug目录再压缩!] • project3.doc [概要设计文档] • 文件4/5: practice2.rar • project4.rar [删除掉debug目录再压缩!] • project4.doc [概要设计文档] • 文件5/5: practice2.rar • project5.rar [删除掉debug目录再压缩!] • project5.doc [概要设计文档] • Upload to module @week15 • Due:see it on the Moodle 201001V1.1

  11. Lab 15. Concurrent Programming • Multiple choice question • Due:See it on Moodle 201001V1.1

More Related