1 / 12

บทที่ 4

บทที่ 4. การ จัดสรรหน่วยประมวลผล (Process Scheduling). หลักสำคัญการจัดลำดับงาน. 1. มีความยุติธรรมสำหรับโปรเซสทุกโปรเซส. 2. ใช้เวลาสั้นในการตอบสนองงานแบบโต้ตอบ. 3. สามารถใช้ซีพียูให้เกิดประโยชน์ได้สูงสุด. 4. สามารถทำงานในระบบแบทช์ได้อย่างรวดเร็ว. 5.

rianna
Download Presentation

บทที่ 4

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. บทที่ 4 การจัดสรรหน่วยประมวลผล (Process Scheduling)

  2. หลักสำคัญการจัดลำดับงานหลักสำคัญการจัดลำดับงาน 1 มีความยุติธรรมสำหรับโปรเซสทุกโปรเซส 2 ใช้เวลาสั้นในการตอบสนองงานแบบโต้ตอบ 3 สามารถใช้ซีพียูให้เกิดประโยชน์ได้สูงสุด 4 สามารถทำงานในระบบแบทช์ได้อย่างรวดเร็ว 5 เกิดผลลัพธ์ในการทำงานมากที่สุด

  3. วิธีจัดลำดับการทำงานScheduling Algorithms มาก่อนได้ก่อน (First-Come, First-Served Scheduling : FCFS) สั้นที่สุดได้ก่อน (Short-Job-First Scheduling : SJF) ศักดิ์สูงได้ก่อน (Priority Scheduling) วนรอบ (Round-Robin Scheduling : RR)

  4. มาก่อนได้ก่อน (FCFS)

  5. มาก่อนได้ก่อน (FCFS) วิธีคำนวณ P1=0, P2=24, P3=27 (0+24+27) / 3 = 17 ดังนั้น เวลารอคอยโดยเฉลี่ย 17 หน่วยเวลา

  6. สั้นที่สุดได้ก่อน (SJF)

  7. สั้นที่สุดได้ก่อน (SJF) วิธีคำนวณP4=0, P1=3, P3=9, P2=16 (0+3+9+16) / 4 = 7 ดังนั้น เวลารอคอยโดยเฉลี่ย 7 หน่วยเวลา

  8. ศักดิ์สูงได้ก่อน

  9. ศักดิ์สูงได้ก่อน วิธีคำนวณ P2=0, P5=1, P1=6, P3=16 , P4=18 (0+1+6+16+18) / 5 = 8.2 ดังนั้น เวลารอคอยโดยเฉลี่ย 8.2 หน่วยเวลา

  10. วนรอบ (RR) กำหนดให้ใช้งานซีพียูแบบวนรอบ ที่มีเวลาควอตัมเท่ากับ 4 หน่วยเวลา

  11. วนรอบ (RR) วิธีคำนวณ P1= 0+(10-4), P2=4, P3=7 (6+4+7) / 3 = 5.66 ดังนั้น เวลารอคอยโดยเฉลี่ย 5.66 หน่วยเวลา

  12. แบบฝึกหัด กำหนดให้ใช้งานซีพียูแบบวนรอบ ที่มีเวลาควอตัมเท่ากับ 2 หน่วยเวลา ให้แสดงวิธีการคำนวณหาเวลารอเฉลี่ย โดยใช้อัลกอริธึม ดังนี้ FCFS SJFPriority RR

More Related