CPS 209 Lecture 7: Lecture 7 Concurrency
Document Summary
Java virtual machine: one of the processes running inside a computer execution of jvm: simulates an imaginary computer that executes byte code (which resides in a sandbox) inside your real computer. Data memory of the jvm has 3 parts, which are intensely secured from improper use: bytecode object heap local variable stack areas. How is communication done b/w java threads? all threads share the same object heap so communication occurs via reading and writing shared objects. What is divided into separate threads? execution of the bytecode program each thread has its own program counter points to the position in the bytecode where the thread is currently being executed at. Why is it necessary for each thread to have its own stack of local variables? useful in general bc different threads execute different parts of the program. Threads generally: share same object heap have their own local variables have an internal program counter.