CS 18000 Lecture Notes - Lecture 12: Java Virtual Machine, Program Counter, Control Flow
Document Summary
Control flow: at any time in a (sequential) java program, there is a currently executing . Operator: execution of a (sequential) java program is mostly a sequence of operations . The fetch-execute cycle (a simplified view : the jvm performs a fetch-execute cycle . Fetch the instruction from the current location (also known as program counter or pc ) in memory. Update the current location (either to next location in memory or as a side effect of executing the current instruction, e. g. , a jump instruction) Repeat: think of the pc as an arrow pointing to the instruction being executed. A single thread of execution weaves its way through your program. A single pc ( program counter ) identifies the current instruction being executed: concurrent: Multiple threads of execution are running simultaneously through your program. Multiple pcs are active, one for each thread. Java threads: thread class with run() method, allows creation and manipulation of threads import java. lang.