1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
gayaneshka [121]
4 years ago
7

Your task is to improve a multi-threaded program that frequently writes small entries to a shared file by introducing a layer th

at merges in memory before writing to file to reduce the number of expensive I/O operations. Imagine a program which writes to file small log entries very frequently. The program is multithreaded and each thread writes log entries to a common log file. To simplify implementation, each thread just writes log individually with blocking I/O interface. Even though threads write to the shared file concurrently without any locking, this is correct because the OS guarantees the atomicity of individual write() operation
Computers and Technology
1 answer:
VikaD [51]4 years ago
5 0

Answer:

The program is given below

import java.io.IOException;

import java.util.InputMismatchException;

import java.util.Scanner;

public class Add {

public static void main(String[] args)throws IOException

{

   int a=0, b=0, sum;

   Scanner sc=new Scanner(System.in);

   System.out.println("Enter the numbers to be summed");

   try{

       a=sc.nextInt();

       sc.nextLine();

       b=sc.nextInt();

   }

   catch(InputMismatchException e){

       System.out.println("Please enter an Integer number");

       e.printStackTrace();}

   catch(Exception e){System.out.println(e);}

   sum=a+b;

   System.out.println(sum);

   sc.close();

}

}

You might be interested in
A chip that wakes up the computer system
bezimeni [28]

Explanation:

The wake-up receiver is an ultra-low power chip that continuously looks out for a specific radio signal, called a wake-up signature, that tells it when to wake up the main device

4 0
3 years ago
How you will install an operating system on your computer
defon
Someone can install an operating system by disk or removable storage media.

Disk being floppy, tape or commonly a DVD.

Removable storage being a USBdrive.
5 0
3 years ago
________ allows only limited use of media that has been legally purchased.
Reptile [31]
Digital Rights Management (DRM) allows only limited use of media that has been legally purchased. The DRM includes access control technologies for <span>copyright protection for </span>digital media. DRM defines <span>what you as a software or hardware user can and can't do with the media and hardware you've purchased. </span> 
3 0
3 years ago
An attacker attempting to break into a facility pulls the fire alarm to distract the security guard manning an entry point. Whic
OlgaM077 [116]

Answer:

'Urgency' is the name of this type of social engineering attack.

Explanation:

Social engineering attack describes a broad range of malicious activities accomplished through human interactions. It uses psychological manipulation to trick users into making security mistakes or giving away sensitive information.

In 'Urgency attacks', the attacker uses some sort of emergency or urgent situation to get someone/people to do what they want or divulge a piece of information.

Hope this Helps!

5 0
4 years ago
3. State whether the given statements are true or false. a. The computer is called a data processor because it can store, proces
andriy [413]

Answer:

a,b,c,d,f,g are true only e is false

6 0
3 years ago
Other questions:
  • Which of the following are important for protecting computing devices and systems? Physical safeguards like a secure space prote
    7·1 answer
  • How to check the balance on a visa gift card?
    6·1 answer
  • What is the main role of LDAP?
    14·1 answer
  • Which tool is best used to test an electrical current for a power source?
    8·1 answer
  • Please help with attached file
    8·2 answers
  • 4. When you see ##### in a cell, you should
    14·2 answers
  • (Find the number of days in a month) Write a program that prompts the user to enter the month and year and displays the number o
    8·1 answer
  • Why there isn't in italian this app?​
    15·1 answer
  • Create a high-level plan to perform a gap analysis for Fullsoft Inc
    7·1 answer
  • The current in a resistor is 5.0 A, and its power is 60 W. What is the voltage?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!