M362 2008 Exam (part 1) Flashcards

1
Q

For each of the following system configurations, explain whether it is capable of being concurrent, parallel, both, or neither. Briefly justify each answer.

(a) One processor, two activities
(b) Four processors, two activities
(c) Three processors, five activities
(d) Two processors, one activity

A

(a) One processor, two activities – concurrent but not parallel. Two activities can share one processor by taking turns to use the processor in pseudoparallel fashion.
(b) Four processors, two activities – parallel (and therefore concurrent) because two activities can run simultaneously on two of the processors, with two processors idle.
(c) Three processors, five activities – concurrency is possible by sharing the processors among all the activities. Some parallelism is possible because there are multiple processors but not all activities can be active at once.
(d) Two processors, one activity – neither concurrent nor parallel because one activity by definition can only be doing one thing at a time.
[An alternative answer is that parallelism or concurrency are possible if the activity can be broken down into two or more co-operating sub-activities.]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain the need for a processor to run in at least two modes, including a supervisor mode.

A

A processor must mediate between concurrently running processes to prevent errors.

To achieve this, a processor must be able to run in at least two modes, one of which is used for privileged instructions called the supervisor mode.

Privileged instructions include those involved in performing input and output, as well as those controlling entry and exit from supervisor mode.

Control can be exercised over how privileged instructions are executed, and user processes can be prevented from causing certain kinds of system failures or arbitrarily executing sensitive code, because the processor can only perform these instructions when it is in the right mode. This allows policies to be enforced.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain how the following mechanisms are related:

  • entry protocols
  • exit protocols
  • semaphores
A

When several concurrently executing processes share data, the shared data needs to be protected so that only one process at a time can have access to it.

A semaphore is a mechanism designed to protect shared data, through its operations ‘wait’ and ‘signal’ which function like an entry and an exit protocol respectively.
Protection can be achieved by requiring that a process executes the entry protocol before using the shared data. If another process is already using the shared data, then the entry protocol will make the new process wait.

Once a process has finished using the shared data it should execute the exit protocol. This will then alert waiting processes that they can try to execute the entry protocol again. Or if no processes are waiting, allow the next new process that wishes to execute the entry protocol.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Give a definition of the term “virtual machine”.

A

A virtual machine is an abstract computing device that is implemented in software.

A virtual machine defines a certain set of instructions and how code and data are organised in the machine’s memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Name two components of the Java Virtual Machine and state what they do.

A

The JVM includes a bytecode verifier that checks whether the bytecode about to be executed has not been tampered with.

The JVM also includes a class loader, which loads classes at runtime into the JVM’s memory.

Other components are the bytecode interpreter, garbage collector and JIT compiler.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain the following statement: “Java’s RMI is a form of communication that follows the distributed object paradigm”.

A

The distributed object paradigm extends the object-oriented paradigm to a distributed setting, so that local and remote objects are treated in the same way and have the same capabilities.

RMI is effectively extending the way that objects invoke methods on other objects to a distributed setting, and hence belongs to the distributed objects paradigm.

RMI works by adding an additional layer that deals with the lower level details of the communication, such as data marshalling and sockets.

To use RMI requires the existence of a registry so that objects can look up where other objects are located, in order to invoke methods on them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The execution of three transactions T1 ,T2 and T3 involving three objects A, B and C is interleaved as shown in Schedule 1.

Explain what is meant by ‘conflicting operations’.

A

Operations are conflicting if the order in which they are carried out affects the result.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The execution of three transactions T1 ,T2 and T3 involving three objects A, B and C is interleaved as shown in Schedule 1.

List the conflicting operations in Schedule 1, indicating the order of transaction execution (you may use the step numbers to indicate which operations conflict).

A

The conflicting operations:
2 and 7, T2 < T1
3 and 8, T2 < T3
4 and 6, T3 < T2
6 and 8, T2 < T3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The execution of three transactions T1 ,T2 and T3 involving three objects A, B and C is interleaved as shown in Schedule 1.

Show the precedence graph for Schedule 1 and explain whether it is serializable.

A

The precedence graph shows a cycle (T2 to T3 and T3 to T2), and thus the schedule is not serializable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the three main categories of components in the MVC approach and what are their roles? Illustrate your answer with an example for each category.

A

MVC defines three categories of components: model, view, and controller.
The model is the abstraction of all the domain data in the system.

It is the bank account in a banking application, or a shopping cart in an e-commerce system.
The view is the visualisation of the model. In a web application, the view consists of the HTML pages and the components that create the HTML pages sent to web browsers, the WAP pages sent to mobile devices, or the user interface components sent to a dedicated client.
The controller is the set of components that manage the communications between model and view.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Explain the difference between pull technology and push technology when dealing with clients in a web application. State one approach to implementing push technology.

A

Pull technology is the normal client-server approach where the client receives information or updates only in response to a request that it sends to the server.
With push technology, the server can notify its clients of any significant changes without the clients having to explicitly make a request each time.
This normally requires clients to register with the server in some way, or to subscribe to a service to indicate an interest in updates. The server may update each client individually or may use some more efficient approach such as multicasting where one message is sent to many clients.

Possible approaches to push technology include (only 1 name required, no details required) • multipart/x-mixed-replace;

  • UDP;
  • multicast UDP;
  • TCP;
  • messaging services (such as JMS).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

For each of the following cryptographic services give an example of a scenario in which you might want to make use of it, with a brief explanation of why the service is an appropriate one for that scenario.
• signature
• certificate

A

1.
Signature
Scenario: the recipient wants to check the sender’s identity.
The sender self-authenticates.
This could be used in communications where little is at stake, or where the recipient trusts the sender to self-authenticate, because there is no thirdparty checking the sender’s identity.
2.
Certificate
Scenario: the recipient wants to check the sender’s identity and requires third-party checking of the identity.
This might be used in more important communications, for example, where confidential information might be disclosed and it is important to fully authenticate the sender.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Describe the main function of the ORB in CORBA.

A

The main functions of the ORB in CORBA are:

  • implementing an object request broker service;
  • locating objects able to meet a software request, that is, finding objects able to provide a service to another object;
  • preparing an object to receive a software request;
  • communicating data between two objects taking part in a software interaction.

The question can also be answered in terms of support for transparencies:

  • location transparency – the location of an object is transparent to an object requesting a service;
  • ** implementation transparency** – the implementation language of an object is hidden, and the platform is not specified;
  • object activation state transparency – the client is not concerned with whether or not a server is actually running or a server object has been activated;
  • communication mechanism transparency – the protocol used by ORBs to communicate with each other is transparent to an object requesting a service.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly