Supporting tech Flashcards
What can a process be thought of?
Process = program in execution
Has:
- Code that is executing
- Data operated on
- Execution state
Run on a single machine
What is included in execution state?
- Register contents
- PC
- Call stack
- etc,
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
- commonly referred to as “lightwight processes”
May be though of as a memory space (contained code and data) together with a single thread.
- It executes the sequential code that manipulates the process’ data (sharing data with process)
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?
- Understand the model of concurrency itself
- new way of thinking
- Ensuring concurrent threads do not interfere with one another.
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.
- Takes data, serializes it, sends and de-serializes it on the other side
Problem:
- Passings information between different machines
- data sizes
- encodings
- endians
In general what are two common approaches to RPC that deal with data translations to various machines?
- Wire/Network format
- Everything is converted to on specific format before sent
- Each machine translates from standard format to their specific format upon reciept
- (Overhead, as translation not needed when sending to same machine types)
- Each machine translates from standard format to their specific format upon reciept
- Everything is converted to on specific format before sent
- Cross-Bar
- The type of machine content is being sent to is known and converted to that specific format before sent
- (More complicated but more efficient)
- The type of machine content is being sent to is known and converted to that specific format before sent
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
- Seamless
- Natural (most java symantics)
- Reliable
- Safety (java run time environment)
In general how does one use RMI?
What is needed on Client machine?
What is needed on Server machine?
- The client needs to get a reference for the remote object
- Then can call the methods in that object
- The object itself must be a “remote class”
- extends java.rmi.server.UnicastRemoteObject
- implements a remote interface
- public interface extends java.rmi.Remote
- every method throws java.rmi.RemoteException
- public interface extends java.rmi.Remote
- Client does not instantiate, it creates a remote interface type
Exercise
Complete the Hello World RMI example from class
What are the important characteristics of scripting languages?
- Interpreted - easy to use and distribute
- Weakly typed - manipulate any collections
- Powerful - have special features
- pattern matching and manipulation
- Flexible and composable
- rapid prototyping
- portability (don’t need multipl executables)
- Easy access to OS provided information
- file contents
- date
What are the requirements for passing parameters using RMI?
The parameters need to be any of the following:
- primitives
- serializable (like Integer)
- extend class remote
What does interoperability include?
- Communication protocol (such as IP address)
- Data formats and translations for transmissions (like RPC)
- Data access (databases Baybee)
What are the two low-level standards for interoperability?
- eXternal Data Representation (XDR)
- Abstract Syntax Notation (ASN1)
These are used as encoding/decoding standards for different machines/OSs to communicate
What is Service Oriented Architecture (SOA)
Ad-hoc distributed systems from pre-existing parts
Service-oriented architecture (SOA) is a style of software design where services are provided to the other components by application components, through a communication protocol over a network. The basic principles of service-oriented architecture are independent of vendors, products and technologies.[1] A service is a discrete unit of functionality that can be accessed remotely and acted upon and updated independently, such as retrieving a credit card statement online.
Why is it not always desireable to allow remote DB access?
- Difficult to control access
- Interfaces can be seen as unfriendly
- Trust and Authentication issues
What is ODBC?
Open Data Base Connectivity
A standard for accessing any DB safely and remotely
What is an ODBC driver?
Each DB vendor provides an “ODBC driver” which
- Allows connections in a standard way
- Accounts and permissions provided by the DB itself (so incredibly safe)
- Results are sent back in a standard/readible way (by any machine)