Slide design: Dr. Mark L. Hornick

Slides:



Advertisements
Similar presentations
Week 9, Class 3: Model-View-Controller Final Project Worth 2 labs Happens-Before ( SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
Advertisements

SE3910 Week 2, Class 2 Today Real-Time Systems Embedded Systems Other ??? Week 3 Tuesday Lab Lab start TBA SE-2811 Slide design: Dr. Mark L. Hornick Content:
Discussion Week 3 TA: Kyle Dewey. Overview Concurrency overview Synchronization primitives Semaphores Locks Conditions Project #1.
1 Concurrent Languages – Part 1 COMP 640 Programming Languages.
Today Quiz Multithreading Options Qt socket buffers between threads Quiz today & Tuesday in lab SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr.
Week 2, Day 2: The Factory Method Pattern Other good design principles Cohesion vs. Coupling Implementing the Strategy Pattern Changing strategies (behaviors)
Week 6, Class 1 & 2: Decorators Return Exam Questions about lab due tomorrow in class? Threads Locking on null object invokeLater & the squares example.
CS2910 Week 1, Class 2 Today Announce Prof. Michael Vieau’s S-341 6p Thurs Wk 2 Assignment for tomorrow Data Encoding, Part 1 Parsing Data Muddiest Point.
Week 3, Day 2: Threads Questions about Threads “Multithreading” in Swing Lab tomorrow: Quiz Lab 3: Threading! SE-2811 Slide design: Dr. Mark L. Hornick.
SE-3910 Real-time Systems Week 5, Class 2 – Lab turn-in page is up! – Use interrupts in a Linux/C environment – Scheduling – Watchdog follow-up Watchdog.
CS2852 Week 3, Class 2 Today Stacks Queues SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
CS2852 Week 5, Class 2 Today Queue Applications Circular Queue Implementation Testing SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
CS2852 Week 7, Class 1 Today Binary Search Tree Implementing add Implementing find Return Quiz 4 (second attempt) Both sections are graded SE-2811 Slide.
Today Return Quiz First release of final project template Multithreading Options Qt socket buffers between threads Tomorrow: Quiz Interthread communication.
Today Final Project “Preview” Real-time concurrency Multithreading Options pthreads qthreads GPIO.h & GPIO.cpp Quiz tomorrow & Tuesday in lab SE-2811 Slide.
Today Return Quiz First true release of final project (Lab 8) Multithreading Options Qt socket buffers between threads SE-2811 Slide design: Dr. Mark L.
Week 9, Class 3: Java’s Happens-Before Memory Model (Slides used and skipped in class) SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
Week 5, Day 2: Decorator Decorators Muddiest Point Tomorrow: Quiz on lab reading: web.msoe.edu/hasker/se2811/labs/5/ SE-2811 Slide design:
Today Quiz not yet graded Final report requirements posted More on Multithreading Happens-Before in Java SE-2811 Slide design: Dr. Mark L. Hornick Content:
CS2852 Week 3, Class 2 Today Big-O runtime analysis Linked Lists Muddiest Point Lab Quiz Includes writing a method from ArrayList class (See next slide)
Today Signals Nyquist Theorem (revisited) Audio Sampling Latency and Bandwidth Scheduling Theory SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr.
Week 7, Class 1: The Command Pattern (cont.) Get Ready for Poll Everywhere Labs 2 & 3 returned Lab 7 due this evening at 11pm Quiz tomorrow at start of.
CSCI1600: Embedded and Real Time Software Lecture 17: Concurrent Programming Steven Reiss, Fall 2015.
CS2910 Week 8, Class 2 Today Return Quiz Look at Schedule TCP implementation! Week 8, Monday Quiz on SMTP May include some questions requiring you to interpret.
Week 10, Day 3 Review for the quarter SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
Today Quiz not yet graded (Sorry!) More on Multithreading Happens-Before in Java Other langauges with Happens-Before Happens-Before in C++ SE-2811 Slide.
CS2910 Week 7, Class 1 Today Capturing SMTP with Thunderbird Tomorrow Extra office hour at 11 am (right after lab) Friday Office hour cancelled SE-2811.
Week 6, Class 3: Composite Swing composites File composites Computer composites SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
Week 8, Class 3: Model-View-Controller Final Project Worth 2 labs Cleanup of Ducks Reducing coupling Finishing FactoryMethod Cleanup of Singleton SE-2811.
Week 5, Class 3: Decorators Lab questions? Example: Starbuzz coffee Basic Pattern More examples Design Principles Compare with alternatives SE-2811 Slide.
SE3910 Week 8, Class 2 Week 4 Lab: Please return your graded Lab 4 to me so I can enter it in my gradebook Week 7, Class 2 (Wednesday) Half-Exam 2 Done.
SE3910 Week 8, Class 3 Week 4 Lab: Please return your graded Lab 4 to me so I can enter it in my gradebook Week 9 Lab: Individual demos of working sub-modules.
CS-2852 Data Structures Week 5, Class 3 – Testing and Recursion Queue Implementing finite queues Binary Search Recursion Tomorrow – Quiz, Lab demos, Lab.
Threads Some of these slides were originally made by Dr. Roger deBry. They include text, figures, and information from this class’s textbook, Operating.
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
Slide style: Dr. Hornick
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
Week 2, Day 1: The Factory Method Pattern
Polling vs. Interrupts CS2852 7/20/2018
Polling vs. Interrupts CS2852 9/18/2018
Week 6, Class 2: Observer Pattern
Week 7, Class 1: The Command Pattern (cont.)
Midterm review: closed book multiple choice chapters 1 to 9
Computer Science & Engineering Electrical Engineering
CSCI1600: Embedded and Real Time Software
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Polling vs. Interrupts CS2852 4/21/2019
Slide design: Dr. Mark L. Hornick
Week 8, Class 3: Model-View-Controller
CS2911 Week 3, Class 3 (And wk4-c1)
Slide design: Dr. Mark L. Hornick
11. MVC SE2811 Software Component Design
Week 8, Class 3: Model-View-Controller
SE-1021 Software Engineering II
11. MVC SE2811 Software Component Design
CSCI1600: Embedded and Real Time Software
Slide design: Dr. Mark L. Hornick
SE-3910 Real-time Systems Week 4, Class 1 Quick-Quiz (Ungraded!)
Slide design: Dr. Mark L. Hornick
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Slide design: Dr. Mark L. Hornick
EECE.4810/EECE.5730 Operating Systems
Slide design: Dr. Mark L. Hornick
Presentation transcript:

Slide design: Dr. Mark L. Hornick SE3910 5/7/2019 SE3910 Week 9, Class 1 Week 9 Lab: Individual demos of working sub-modules Modules that will communicate should use those interfaces during the tests Today Quiz TBA ASAP: Reinstall IntelliJ if you still use it Monday: Class time -> Office Hours Full agenda: Return Exam Questions about lab due tomorrow in class? Threads: Locking on null object Threads: invokeLater Threads: The squares example Decorator Class Diagram More on Java IO Class diagrams Design Principles in the patterns we’ve seen so far Compare with alternatives Decorator vs. array approach suggested in class Non-decorator array – decorator can be added on without modifying the original hierarchy Decorator has “before-after” and possibly other combinatorial control that would be hard-coded in array [Show “screenshot” of discussion from class? Or just re-type?] Strategy vs. Decorator class diagrams side-by-side Structural difference (inheritance optional in Strategy pattern?) Decorator vs. “Strategy” array Perhaps next: Coding Starbuzz coffee (?) Add real patterns ArrayList – null-checking Java I/O: Students do coding examples http://stackoverflow.com/questions/9358821/should-i-extend-arraylist-to-add-attributes-that-isnt-null SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder Dr. Josiah Yoder

Quiz topics Rate Monotonic Analysis CPU usage SE3910 5/7/2019 Quiz topics Rate Monotonic Analysis CPU usage Happens-before, caching, reordering, and sequential consistency Short-answer questions Code analysis SE-2811 Dr.Yoder Dr. Josiah Yoder

Textbook references This material comes from TBA SE3910 5/7/2019 Textbook references This material comes from TBA Chapter 4 of our custom text Chapter 3 of Laplante & Ovaska, Real-Time Systems Design and Analysis, 4th ed. Section 3.3: Mailboxes, Semaphores, Deadlocking.. SE-2811 Dr.Yoder Dr. Josiah Yoder

Predicting CPU usage τi – task i pi – period i (ms) SE3910 5/7/2019 Predicting CPU usage τi – task i pi – period i (ms) ei – execution time (ms) ui -- %CPU used for task i SE-2811 Dr.Yoder Dr. Josiah Yoder

Predicting CPU usage (2) SE3910 5/7/2019 Predicting CPU usage (2) ui = ei/pi U = 𝑖 𝑢 𝑖 SE-2811 Dr. Yoder Dr. Josiah Yoder

CS2852 5/7/2019 In-Class Exercise Calculation: What is the processor utilization for this problem? Based on RMA, what order will they execute and how will they execute? Hints: Draw release times, break up processing into multiple frames if needed. Skip calculation if time short SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling Dr. Yoder

Rate-Monotonic Example CS2852 5/7/2019 Rate-Monotonic Example See example soln. in text. SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling Dr. Yoder

Simplifying Assumptions needed for RMS SE3910 5/7/2019 Simplifying Assumptions needed for RMS All tasks in the task set considered are strictly periodic. The relative deadline of a task is equal to its period. All tasks are independent; there are no precedence constraints. No task has any nonpreemptible section, and the cost of preemption is negligible. Only processing requirements are significant; memory and I/O requirements are negligible. SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling Dr. Josiah Yoder

When is Rate Monotonic Guaranteed to work? SE3910 5/7/2019 When is Rate Monotonic Guaranteed to work? For n tasks, RMA is guaranteed to meet all deadlines if 𝑈≤𝑛( 2 1 𝑛 −1) For a very large number of tasks (n approaching infinity), RMA is guaranteed to meet all deadlines if 𝑈≤ ln 2 ≈0.69 For many practical applications, RMA will work if 𝑈≤0.85 Dr. Josiah Yoder

Multithreading terminology SE3910 5/7/2019 Multithreading terminology Semaphores Signals Monitors Mailboxes SE-2811 Dr.Yoder Dr. Josiah Yoder

Semaphores Provides: Acquire – obtain a lock on a resource 5/7/2019 Semaphores Provides: Acquire – obtain a lock on a resource Release – release a lock on a resource Can allow multiple locks up to some fixed amount – e.g. to count how many processes have requested to use a socket SE-2811 Dr.Yoder Dr. Josiah Yoder

Monitors A monitor is a section of code protected by a lock. 5/7/2019 Monitors A monitor is a section of code protected by a lock. e.g. the synchronize statement in Java e.g. can implement with semaphore e.g. lock/unlock semantics in C/C++ pthreads, etc. SE-2811 Dr.Yoder Dr. Josiah Yoder

Signals Essentially a message between different parts of a program 5/7/2019 Signals Essentially a message between different parts of a program Implemented in Java: notify/wait Can implement with semaphores: Start with semaphore locked To wait, try to lock on the semaphore To release, unlock the semaphore SE-2811 Dr.Yoder Dr. Josiah Yoder

Mailboxes A mailbox provides: send: Send a message to another thread 5/7/2019 Mailboxes A mailbox provides: send: Send a message to another thread receive: Get the message. Block until a message is ready Rather like TCP. SE-2811 Dr.Yoder Dr. Josiah Yoder

Consider this code: synchronized(this) { im = getImage(); q.put(im); } synchronized(this) { im = q.get(im); display(im); } SE-2811 Dr.Yoder