Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Operating System Expert

problem 1:

A) List one advantage and one disadvantage of using:

i) Sequential systems.
ii) Concurrent systems.

B) What is the difference between cooperative multitasking and preemptive multitasking?

C) Briefly describe the meaning of each of the following:

i) Condition synchronization.
ii) All-or-nothing atomicity of a transaction.
iii) Remote Method Invocation (RMI).

D) What is the difference between the following Enterprise Java Beans: entity beans, session beans, and message-driven beans.

E) describe how cookies can be used to maintain an HTTP session. Draw an illustration to support your answer.

problem 2:

Consider the processes in the table below. You are required to apply the following scheduling policies on these processes and find f, q, and n. Also, illustrate the time lines of the processes by adding them to the figure following the table (the blue arrows at the bottom of the figure represent the arrival time of the processes).

a)  First-In, First-Out (FIFO)
b)  Shortest Job First (SJF)

1657_normalized turnaround.jpg

problem 3:

A) Consider the class below which models a counter object that has two methods to increment or decrement its only instance variable, counter. 

a) You are required to apply the wait-notify mechanism in order to make the class thread-safe. Of course the methods need to be synchronized first. Assume that the value of the counter should be kept between 0 and 10.

b) Repeat (a) using a different technique which allows multiple condition variables for different locks, and uses the Java.util.concurrent.locks package. Assume that you have two conditions: notFull and notEmpty.

public class Counter {
    private int counter = 0;
    public void increment() {
        try {
            counter++;
        } catch(Exception e){ 
        } finally {          
        }
    }
    public void decrement() {
        try {
            counter--;
        } catch(Exception e){            
        } finally {
        }
    }
}


B) Consider the MyClient class below. When the main method is executed, the user is asked to enter his/her name and location. This data is sent to a server located at the “localhost” (i.e. on the same computer). Copy this code to a new project in NetBeans IDE and run it.

a) Does the code run properly? Justify your answer.

b) Develop a server class, Server_toScreen, to the following specifications:

•  The server should first display a message “Waiting for next client connection…”. (use System.out.println statement here).
•  The server should listen for incoming connections at port 5555.
•  The server should read data sent to it using an instance of BufferedReader class.
•  The server should display the data sent to it on the screen. Use JOptionPane class for this part.
•  The server should keep repeating (a) to (d) in order to receive data from other clients.

In your solution document, you will need to run the project and include screenshots of the results, before and after writing the server class. The screenshots should include evidences that the code was run on your own machine.

import java.io.*;
import java.net.*;
import javax.swing.JOptionPane;
 
public class MyClient {
    Socket socket;
    Printpreparer out;
    public void run() throws IOException{
        String s;
        socket = new Socket("localhost", 5555);
        out = new Printpreparer(socket.getOutputStream());
s = JOptionPane.showInputDialog("What is your name?");
        out.println(s);
        s = JOptionPane.showInputDialog("Where are you now?");
        out.println(s);
        out.close();
        socket.close();
    }
    public static void main(String[] args) throws IOException {
        new MyClient().run();
    }
}

C) In this problem, you will re-prepare the server class in problem (B). However, in this time the server is required to save the received data in a database instead of displaying them on the screen. This database should be located at the same computer as the server (i.e. localhost). The name of the database is clientsData, and the data will be saved in a table named CLIENTS which has two text fields: name and location. Name your server class Server_toDB.

D) Assume we have an entity bean, ClientsEntity, which models a database table, clients, with two fields: name and location. This entity bean has getter methods for all its instance variables. In this problem, you need to do the following:

a) Develop a session bean that utilizes the above entity bean in order to retrieve the names of the clients stored in the database. The session bean is stateless, and it will be accessed remotely. In your solution document, you need to provide the following:

• The code for the remote interface implemented by the session bean. The interface should include one abstract method, void getNames().

• The code for the session bean which includes implementation of the getNames() method. This method should query the clients table for all its records. Then it should create one string by concatenating all names stored in the name field of the clients table. This string should finally be returned by the method.

problem 4:

Using the AOU’s eLibrary facility and the internet, locate the paper indicated below and answer the following in your own words:

a) According to the paper, what is the problem with the current deadlock detection approaches?

b) What is name of the approach presented in the paper? List its advantages.

Operating System, Computer Science

  • Category:- Operating System
  • Reference No.:- M9719

Have any Question?


Related Questions in Operating System

Assignment -building a multi-threaded web server using c

Assignment - Building a multi-threaded web server using C and p threads, following the model from the lecture. Your program will have one thread acting as a dispatcher thread, listening fornetwork connections with reques ...

Question students working at individual pcs in a computer

Question : Students working at individual PC's in a computer laboratory send their files to be printed by a server that spools the files on its hard disk. Under what conditions may a deadlock occur if the disk space for ...

Question description of lasa in this assignment you will

Question: Description of LASA: In this assignment, you will select a real-world operating system (can be for a PC, server, tablet, handheld, or embedded device). You will introduce the operating system and its components ...

Foundation of information technologyresearch types of

Foundation of Information Technology Research types of operating systems that are currently available and provide a scenario in which the operating system you chose would be appropriate to be used in this situation. Expl ...

Question what do you see as the major differences between

Question : What do you see as the major differences between UNIX/Linux and other operating systems, such as Windows and Mac OS X? The response must be typed, single spaced, must be in times new roman font (size 12) and m ...

Question research hex editors available for mac os and

Question : Research hex editors available for Mac OS and Linux. Based on the documentation, how easy would validating these tools be? Select at least two hex editors for each OS, and discuss what you would do to validate ...

Question 1answer the following questions 10 marks a

Question 1 Answer the following questions: 10 marks a. Consider the following page reference string: 3, 1, 4, 1, 2, 3, 5, 3, 2, 1, 2,5, 4, 3, 5, 2, 4,2, 5,3 Using the above page reference string display the contents of t ...

Research types of operating systems that are currently

Research types of operating systems that are currently available and provide a scenario in which the operating system you chose would be appropriate to be used in this situation. Explain why you think the choice you made ...

Question you are a security administrator responsible for

Question: You are a security administrator responsible for providing secure configuration requirements for new laptop deployments. After reading Module 2 of Certified Secure Computer User v2exercises, apply the configura ...

Question note apa format 250 words and three reference

Question: Note: APA format 250 words and three reference without plagarism Computerized Operating Systems (OS) are almost everywhere. We encounter them when we use out laptop or desktop computer. We use them when we use ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As