Ask Question, Ask an Expert


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 {
        } catch(Exception e){ 
        } finally {          
    public void decrement() {
        try {
        } 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 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?");
        s = JOptionPane.showInputDialog("Where are you now?");
    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

Goals1 to gain hands-on experience with fork exec and wait

Goals: 1. To gain hands-on experience with fork(), exec(), and wait() system calls. 2. To master the basics of multi-process application development. 3. To appreciate the performance and fault-tolerance bene_ts of multi- ...

What is the purpose of an embedded operating system and why

What is the purpose of an embedded operating system and why would one be used? Discuss at least two advantages and two vulnerabilities in utilizing an embedded OS. Directions: Your completed assignment should be at least ...

Purpose of this assignmentthe purpose of this written

Purpose of this assignment: The purpose of this written assignment is to verify students' knowledge on some of the topics covered in the second half of the course: The Device Handler, File management, Deadlock, UNIX/Linu ...

1 consider a system of 9 processes p p1 p10 associated

1. Consider a system of 9 processes, P = {p1, ..., p10} Associated with the system are 6 memory cells, M = {M1, .., M6}. The domain and range for each process is given in the following table: Process pi Domain D(pi) Rang ...

Operating system proposalobjectivesyour organization is

Operating System Proposal Objectives Your organization is right now researching the utilization of Linux. Your supervisor has solicited you to look into the possibility from utilizing Linux as a part of both the server a ...

Firewall linux-a simple firewall is a filter which blocks

Firewall (Linux)- A simple firewall is a filter which blocks the packets based on the pre-defined filter rules. There are two general strategies to set-up a filter. One strategy is restrictive firewall which blocks all p ...

Assignmentmultiple-processor scheduling simulationthe goal

Assignment Multiple-Processor Scheduling Simulation The goal of this simulation is to give you some experiences using POSIX Pthreads library functions for thread creations and synchronizations. You will learn how to solv ...

Primary discussion responseprimary discussion response your

Primary Discussion Response Primary Discussion Response: Your classmates, your instructor, and you have been working together over the session as a team. Through discussion board tasks and individual projects, you have s ...

Question 1an important service provided by any system is

Question 1: An important service provided by any system is the ability to run a process on a predetermined schedule without human intervention. The "automation" of tasks can reduce the workload of the system administrato ...

Operating systems- homeworkpurposethe purpose of this

Operating Systems- Homework Purpose The purpose of this exercise is to understand how creating files affects the available disk space and the available i-nodes on a disk partition on Linux/UNIX. Assignment Create and lea ...

  • 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

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate