CSE 8B Lecture 13: Parallel Processing/ Multi-Threading
Document Summary
Threading: where you launch a thread to take care of something, which may take a while, one core which has to switch between several tasks. Parallel programming: have more than one computing resource and are trying to divide up your task. Multiple cores which can run different tasks simultaneously. Keep more threads than cores to ensure all resources are used. Events are threads: each event handler is a thread helps with user experience. Suppose a program runs in 100 seconds. It takes 20 seconds to setup the program, but after that point, the program can be divided perfectly. Same program, but instead, i can only divide the remaining work into 8 separate threads. If i have 16 cores, how long will it take to run: ~22 seconds. Process: program in execution: abstraction of computer, are dynamic. Has a state that evolves over time: can be: Threads == lightweight processes: maintains separate execution context.