Lecture 4:
-
Representation of a process in the kernel: PCB
-
process state;
-
program counter;
-
CPU registers;
-
CPU scheduling information;
-
file descriptor table;
-
memory-management information;
-
accounting information;
-
identification of the blocking events (if the process is blocked);
-
Operations on processes
-
process creation: fork and exec system calls;
-
parent process and child process; tree-structured ancestor-descendent relationships ;
-
Example of process creation: when the kernel is booted, first init process is created; init process then fork off many other processes, one being the login daemon; when a user login, the login daemon fork off the xterm and shell processes for the user environment;
-
process termination: exit
-
Introduction to Java:
-
What is Java: an object-oriented type-safe platform-independent
programming language
-
Why is Java introduced: World-Wide Web, HyperText Transfer Protocol (HTTP),
HyperText Markup Language (HTML), browsers, problems of extending the HTML
and modifying the browsers ---> solution: "platform-independent" code for
displaying a page
-
Requirement on Java: platform-independency, security
-
Solution: Java virtual machine (in some sense, a Java virtual machine is
also an operating system)
-
Security in Java:
-
Java virtual machine provides a set of safeguards;
-
type-safety and strongly-typed: very piece of data (object) in the program
has a type; definition and use of the data (the object) must be consistent
(compatible); at compile time, the Java compiler checks for type compatibility,
and reports error on forbidden operations;
-
A Java example: the sorting program
-
see the example in the tutorial;
-
Values, Objects and Pointers in Java:
-
Can't create a pointer in Java;
-
variables can only hold references to objects, or primitive types;
-
Parameters are passed by value;