1 / 66

ICT301 Concurrent Systems

ICT301 Concurrent Systems. Anthony Lee www.artofstudying.com. ICT301. 10 credits module 7 lectures – selected difficult topics 6 tutorials – practical sessions 3 TMAs. ICT301. 10 credits module 7 lectures – selected difficult topics 6 tutorials – practical sessions 3 TMAs

Download Presentation

ICT301 Concurrent Systems

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. ICT301Concurrent Systems Anthony Lee www.artofstudying.com

  2. ICT301 • 10 credits module • 7 lectures – selected difficult topics • 6 tutorials – practical sessions • 3 TMAs

  3. ICT301 • 10 credits module • 7 lectures – selected difficult topics • 6 tutorials – practical sessions • 3 TMAs • Lecturer and tutors • Electronic conferences • Examination • References Bacon Tanenbaum Andrews

  4. ICT301 • Block 1 – The Foundations • Nature of concurrent systems • Hardware and operating systems support • Processes, multi-threading Programming language needed

  5. ICT301 • Block 2 – Inter-process Communications • Shared and non shared data • Shared and non shared memory • Problems and issues Not fact-based • Requires understanding

  6. ICT301 • Block 3 – Application Considerations • System viability • Transactions • Distributed databases • Standards and mini case study

  7. ICT301 Why study concurrent systems? The Story of “How to get Rich Quickly Without Studying ICT301”

  8. Concurrent Systems Systems with several processes that: • contribute to overall objective • independent • cooperate among themselves • exchange data • synchronise actions • compete for resources • respond toexternal events • interact with external environment

  9. level 7 elevator 3 bypasses a call at level 4 to go up because elevator 1 will be stopping at that level 3 level 6 4 level 5 elevator 1 answers the call at level 4 to go up because someone will be getting off from it at this level level 4 1 level 3 elevator 4 answers a call to go down level 2 2 elevator 2 discharging passengers at level 1 level 1

  10. level 7 Service zone level 6 The system is dynamic and concurrent 4 level 5 level 4 Service zone 3 Service zone 1 level 3 level 2 Service zone 2 level 1

  11. Concurrent Systems • How would the Java program looks like? class ElevatorController { public static void main(String args[ ]) { use for loop ? } }

  12. Concurrent Systems • How would the Java program looks like? class ElevatorController { public static void main(String args[ ]) { use for loop ? } } • independent • cooperate • exchange data • synchronise actions • compete for resources • respond toexternal events • interact with external environment

  13. Concurrent Systems • Inherently concurrent systems • Concurrent by nature • Potentially concurrent systems • Not concurrent by nature • But can be implemented as concurrent systems

  14. Inherently Concurrent Systems • Typical inherently concurrent systems • Real-time and embedded systems • Databases and transaction processing systems • Operating systems

  15. Inherently Concurrent Systems • Typical inherently concurrent systems • Real-time and embedded systems • Hard real time systems • Soft real time systems • Databases and transaction processing systems • Operating systems Aircraft Flight Controls Real time? Information up to date Hard or soft? Response time critical

  16. Inherently Concurrent Systems • Typical inherently concurrent systems • Real-time and embedded systems • Hard real time systems • Soft real time systems • Databases and transaction processing systems • Operating systems Aircraft Flight Controls Real time? Information up to date Hard or soft? Response time critical • Banking: ATM system • Real time? • Hard or soft? • Balance inquiry • Cash withdrawal

  17. Recall our get-rich-quick story Bank accounts ATM GIRO Inherently Concurrent Systems • Typical inherently concurrent systems • Real-time and embedded systems • Databases and transaction processing systems • Operating systems

  18. Inherently Concurrent Systems • Typical inherently concurrent systems • Real-time and embedded systems • Databases and transaction processing systems • Operating systems

  19. Processor Disk Screen Memory Keyboard Printer Inherently Concurrent Systems • Typical inherently concurrent systems • Real-time and embedded systems • Databases and transaction processing systems • Operating systems • Single user

  20. Processor Disk Screen Screen Screen Processor Disk Keyboard Keyboard Keyboard Disk Memory Printer Plotter Inherently Concurrent Systems • Typical inherently concurrent systems • Real-time and embedded systems • Databases and transaction processing systems • Operating systems • Single user • Multi-users

  21. print server print server database server database server 1 1 2 2 3 3 4 4 workstation workstation workstation workstation Inherently Concurrent Systems • Typical inherently concurrent systems • Real-time and embedded systems • Databases and transaction processing systems • Operating systems • Single user • Multi-users • Networked users

  22. Concurrent Systems • So far, inherently concurrent systems • Next, potentially concurrent systems

  23. Potentially Concurrent Systems • Not concurrent by nature • Advantageous to implement concurrent processing • Usually in situations where • large amount of data • large amount of processing • real-time need • parallel processing possible

  24. Potentially Concurrent Systems • Ways to implement concurrent processing • Replicated code with partitioned data • Partitioned code with duplicated data • Pipelined processing • Tree-structured algorithms

  25. Codes that process data Portion of data Codes that process data Portion of data Program that coordinates the processing . . . . . . Codes that process data Portion of data Potentially Concurrent Systems • Ways to implement concurrent processing • Replicated code with partitioned data • Partitioned code with duplicated data • Pipelined processing • Tree-structured algorithms

  26. Matrix operations 23 47 82 57 71 95 38 52 73 44 96 25 17 68 78 36 Potentially Concurrent Systems • Ways to implement concurrent processing • Replicated code with partitioned data • Partitioned code with duplicated data • Pipelined processing • Tree-structured algorithms

  27. Potentially Concurrent Systems • Ways to implement concurrent processing • Replicated code with partitioned data • Partitioned code with duplicated data • Pipelined processing • Tree-structured algorithms Batch 1 Marked by examiner A

  28. Marked by examiner A Marked by examiner B Marked by examiner A Potentially Concurrent Systems • Ways to implement concurrent processing • Replicated code with partitioned data • Partitioned code with duplicated data • Pipelined processing • Tree-structured algorithms Batch 1 Batch 2

  29. Marked by examiner A Marked by examiner B Reviewed by moderator Marked by examiner A Marked by examiner B Marked by examiner A Potentially Concurrent Systems • Ways to implement concurrent processing • Replicated code with partitioned data • Partitioned code with duplicated data • Pipelined processing • Tree-structured algorithms Batch 1 Batch 2 Batch 3

  30. Marked by examiner A Marked by examiner B Reviewed by moderator Marked by examiner A Marked by examiner B Marked by examiner A Marked by examiner A Marked by examiner B Reviewed by moderator Checked by checker Potentially Concurrent Systems • Ways to implement concurrent processing • Replicated code with partitioned data • Partitioned code with duplicated data • Pipelined processing • Tree-structured algorithms Batch 1 . . . Batch 2 Batch 3 . . . Batch 4 . . .

  31. 9 5 5 6 6 8 8 3 3 1 1 8 8 7 7 5 5 2 2 7 7 3 3 9 9 7 5 6 8 4 4 8 8 5 5 2 2 3 1 8 7 5 3 3 8 8 2 7 3 9 2 2 4 4 5 5 7 7 4 8 5 2 1 1 6 6 4 4 2 2 3 8 5 5 2 2 1 1 3 3 4 4 2 4 5 7 8 8 7 7 9 9 1 6 4 2 5 2 1 3 4 8 7 9 Potentially Concurrent Systems • Ways to implement concurrent processing • Replicated code with partitioned data • Partitioned code with duplicated data • Pipelined processing • Tree-structured algorithms

  32. 7 5 6 8 3 1 8 7 5 2 7 3 9 4 8 5 2 3 8 2 4 5 7 1 6 4 2 5 2 1 3 4 8 7 9 7 5 6 8 7 5 6 8 3 1 8 7 5 3 1 8 7 5 6 2 7 3 9 8 2 7 3 9 4 8 5 2 4 8 5 2 3 8 3 8 2 4 5 7 2 4 5 7 1 6 4 2 1 6 4 2 5 2 1 3 4 5 2 1 3 4 8 7 9 8 7 9 Potentially Concurrent Systems • Ways to implement concurrent processing • Replicated code with partitioned data • Partitioned code with duplicated data • Pipelined processing • Tree-structured algorithms

  33. stage 1 stage 2 stage 3 stage 4 Potentially Concurrent Systems • Ways to implement concurrent processing • Replicated code with partitioned data • Partitioned code with duplicated data • Pipelined processing • Tree-structured algorithms

  34. Potentially Concurrent Systems Fields for Applications • Artificial intelligence • Graphical imaging • Natural phenomena analysis • Engineering analysis • Mathematical modelling

  35. Typical architecture Processor Disk Screen Memory Keyboard Printer Basic Computer Architecture Recall operating systems • inherently concurrent • closer look at what it has to do

  36. fetch instruction Instruction 1 Instruction 2 Instruction 3 Instruction 4 Instruction 5 . . . update instruction pointer decode instruction Machine instructions execute instruction Basic Computer Architecture • CPU execution cycle • von Neumann architecture

  37. The big speed difference Consider a 2 GHz CPU • Two thousand million cycles per second Consider human typing at 10 characters per second

  38. The big speed difference Consider a 2 GHz CPU • Two thousand million cycles per second Consider human typing at 10 characters per second If CPU works at 1 cycle per second, human would be typing at one character every six years. Ratio is 200,000,000 to 1

  39. The big speed difference Consider a 2 GHz CPU • Two thousand million cycles per second Consider a hard-disk transferring data at 10 megabytes per second

  40. The big speed difference Consider a 2 GHz CPU • Two thousand million cycles per second Consider a hard-disk transferring data at 10 megabytes per second For every byte read from disk, CPU does about 200 cycles Ratio is 200 to 1

  41. The big speed difference • Two implications arising from big difference in speed: 1. We need buffers 2. The CPU should be deployed elsewhere

  42. The big speed difference • Two implications arising from big difference in speed: 1. We need buffers So the CPU does not have to wait while IO operations takes place

  43. The big speed difference • Two implications arising from big difference in speed: 1. We need buffers 2. The CPU should be deployed elsewhere This means dividing its attention among many tasks

  44. task 1 task 2 task 1 task 3 task 2 5 6 7 1 2 3 4 Basic Computer Architecture • Dividing CPU’s attention among many tasks time-slicing . . . . . . time interval

  45. . . . . . . . . . task 1 task 1 task 2 task 1 task 3 task 2 . . . time interval 5 6 7 1 2 3 4 task 2 task 3 Basic Computer Architecture • Dividing CPU’s attention among many tasks time-slicing

  46. Basic Computer Architecture • Dividing CPU’s attention among many tasks And we need interrupts Task 1 Interrupt service routine Task 2

  47. Basic Computer Architecture • Dividing CPU’s attention among many tasks And we need interrupts Time allocated to a task is up Higher priority request from another program Request to update the real time clock Exceptions encountered in a program Completion of an IO operation

More Related