Event Loops in Practice
July 19, 2017
Event Loops in Practice July 19, 2017 Review Quiz Which of these - - PowerPoint PPT Presentation
Event Loops in Practice July 19, 2017 Review Quiz Which of these is not a common method for speeding up an application? A. Threading B. Forking / Subprocesses C. Compression / Gzipping D. Event Loops / Async programming What is a benefit
Event Loops in Practice
July 19, 2017
Review Quiz
Which of these is not a common method for speeding up an application?
What is a benefit of threading?
doing work
speed up that IO operation
doing garbage collection
preserve memory
What is a disadvantage of threading?
causing segfaults
single threaded programs
causing consistency errors
processors, harming hardware
What is an advantage of event loops / async programming?
execute simultaneously, increasing responsiveness
responsiveness without the danger of threading
looping operators (for, while, do) increasing speed
using more hardware effectively
What is an disadvantage of event loops / async programming?
which can cause programs to terminate
interfere with other programs running on the system
"inside out" way, which can be difficult to learn
program to corrupt program variables
Done!
Contributing to Open Source Projects
Github Example
Create a clone of the project in git
Isolate your changes from irrelevant changes
Make the changes to the project locally
Ask the main project with a "pull request"
https://github.com/snyderp/petes-problem-repo
Using Event Loops
Event Loop Review
Comparison
existing code
increase (vs event loop)
applications
related correctness issues
Threads Event Loops
Conceptual Event Loop
event-loop/{EventLoop, ReadAsync}.java –>
Event Loop Warnings
If you block…
event-loop/{AsyncServer}.java –>
Conclusion