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]
3 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]3 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
Visual Basic: What are arrays, please give an example code.
Drupady [299]

Answer:

An array is a collection of similar types of data. For example, if we want to store the names of 100 people then we can create an array of the string type that can store 100 names. String[] array = new String[100];

<h2>HOPE ITS HELPS YOU</h2>

4 0
2 years ago
Read 2 more answers
A hard disk is divided into tracks which are further subdivided into:​
marusya05 [52]

Answer:

sectors

Explanation:

hard disk contain tracks which are further divided into sectors, for storage purposes.

8 0
3 years ago
What is gland? mention it's type​
stealth61 [152]

Answer:

Gland is an organ that makes one or more substances, such as hormones, digestive juices, sweat, tears, saliva, or milk.

TYPES OF GLANDS :

ENDOCRINE glands release the substances directly into the bloodstream.

EXOCRINE glands release the substances into a duct or opening to the inside or outside of the body.

BRAINLIEST PLEASE

5 0
3 years ago
Read 2 more answers
Distinguish between the savings and investment options.
Tanya [424]

Answer:

Savings,                          Investments

{}Certificate of deposit    Mutual fund

{}Account                         Money Market

{}                                        Gold

Explanation:

Savings is the term used to describe the proportion of ones income not spent or kept for spending at a much later date;

Saving methods includes saving money in deposit accounts, pension savings, and cash savings as well as reducing expenditures

Savings differs from investment in the sense that investments involves more risks than savings

Mutual fund

Mutual fund is a financial resource type involving the bringing together of funds gathered from several investors for investment

Money market

The money market involves buying and selling debt investments that are short terms

Gold

Gold investment is a way of diversifying risk through futures and derivatives and futures contracts

Certificate Deposit

Certificate deposit is a fixed term deposit form of savings that provides an interest on the deposit

Account

Savings and current account are meant for saving funds

8 0
3 years ago
I'm bor.ed so... here's my em.ail
Nataly [62]

Thank you for your email

6 0
3 years ago
Other questions:
  • Which process refers to starting up a computer?
    9·2 answers
  • A ________ topology uses more than one type of topology when building a network. crossover multiple-use fusion hybrid
    11·1 answer
  • Celeste is writing a paper. However, two pages in, her computer shuts down unexpectedly. She never saved her paper, and all her
    12·2 answers
  • How do you check how much space is left in current drive?
    9·1 answer
  • What are digital forensic techniques? A. Identifying, extracting, and evaluating evidence obtained from digital media such as co
    11·1 answer
  • Create a function names minElement() that takes an array of numbers as a paaramter and returns the min value of the array. The a
    9·1 answer
  • Sharl downloads images from an online library and uses them in her work. The images are shared under the Creative Commons Attrib
    13·1 answer
  • Group of programs are software <br>​
    11·1 answer
  • What can I do If my Texas Instrument TI-84 calculator is not giving accurate answers?
    6·1 answer
  • you are asked to create a four-digit code using the numbers from 1 to 9. how many possible codes are there--assuming that number
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!