What can a process be thought of?
Process = program in execution
Has:
Run on a single machine
What is included in execution state?
What does a distributed application consist of?
Consists of processes running on different machines that communicate with each other via a network
What are threads?
Threads are cheaper alternatives to processes
May be though of as a memory space (contained code and data) together with a single thread.
What is meant bu a thread being a “unit of activity” alone?
As an example, it’s like the method/funtion call .

How does more than one thread(“unit of activity”) work in memory space.
Draw a diagram
The memory space is shared among the cooperating, concurrent threads.
The memory space still contains a program (muli-threaded now) and the data it operates on.

What are two core challenges that threads introduce?
What is the definition of concurrency?

In general, how does a multi-process program start?
A single process program creates more processes
How are new processes created in a *nix system?
the fork system call. A literal clone of the current running process is created.
What does fork( ) return and why is it significant?
Provide a quick example of what the code looks like
It returns either 0 or the process id (pid) of the child we created.
0 = we are the parent
!0 = we are a child
With this pid difference, everything else is the same.

What is the code sequence you often see in a child process?
The child process then calls to execute a different program
This is done using an “exec” system call.

In general, write basic code that starts a new thread in Java.
public class main { public static void main(String[] args){ Thread thread1 = new MyThread(); thread1.go(); } } public class MyThread implements runnable { private Thread me; public MyThread(){ //constructor } public run(){ //we are off and running in a new thread } public go(){ me = new Thread(self); me.start();//pops over to run } }
What is a race condition?
If we have two threads running that can both access and modify the same variable X (a bank balance) then different results may be seen deperending on the order of accesses to X
The end result depends on which programs get to the data first.
What is the general server code for a Socket Stream?

What is the general Client Code for a Socket Stream?

In general what is the server code for a Datagram Socket?

What is the general client code for a Datagram Socket

In general what is a RPC and what problem does it attempt to solve.
Remote Procedure Call is a way to call a method (with parameters) on a remote machine.
The problem is solves is that a remote machine is not sharing the same memory and stack as the calling client machine. So how do we abstract away the passing on messages with these variables to call the remote methods

In general, how does RPC work?
RPC software translates procedure calls into message passing using marshalling and de-marshalling.
Problem:
In general what are two common approaches to RPC that deal with data translations to various machines?
Explain how an RPC compiler works for C
The work is done in automatically generated stub programs

In general what is RMI?
Remote method invocation
An abstration for remote method calling in Java
What are the goals of RMI