answer.
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
Sophie [7]
2 years ago
4

Race conditions are possible in many computer systems. Consider a banking system that maintains an account balance with two func

tions: deposit(amount) and withdraw(amount). These two functions are passed the amount that is to be deposited or withdrawn from the bank account balance. Assume that a husband and wife share a bank account. Concurrently, the husband calls the withdraw() function and the wife calls deposit(). Describe how a race condition is possible and what might be done to prevent the race condition from occurring.
Computers and Technology
1 answer:
vampirchik [111]2 years ago
4 0

Answer:

Synchronize the bank account data in order to resolve race condition

Explanation:

Race condition is an unwanted situation where 2 or more then 2 process/thread perform some operation on shared data.

In this case, two operation wants to change bank account data by performing two different operation on share data.

In order to resolve the race condition, We only need to allow one thread at a time to alter shared data (in our case bank account). So the other thread/process will wait for the first thread to finish its task.

From doing this, only on operation will occur on shared bank account, i.e. deposit or withdraw.

In java, to resolve race condition we put shared data into synchronized block. Which will prevent multiple threads to perform there tasks on shared data simultaneously.

You might be interested in
The piston engine uses the ________ to convert the reciprocating motion of the piston into rotary motion.
PSYCHO15rus [73]

The piston engine uses the crankshaft to convert the reciprocating motion of the piston into rotary motion.

<span>The crankshaft is used to convert reciprocating motion of the piston into rotary motion, while the conversion process is called torque, which is a twisting force. Aside from crankshaft, there are a total of four parts of the engine that work together in order to convert the reciprocating motion into rotary motion namely cylinder, or also called the chamber of the piston, the piston itself, and the connecting rod.</span>

5 0
2 years ago
Which of the following is NOT a benefit of virtual memory? speed up of process creation increases in the effective access time o
lubasha [3.4K]

Answer:

speed up of process creation increases in the effective access time of memory

Explanation:

Virtual memories are often used in order to save up ram for other applications and not being limited by the actual physical memory that we have, in this case the virtual memory is slower than normal memories since they are not actual memories and are restricted to the spee of the connection or the speed of the disk where they are located.

8 0
2 years ago
Find true or false. A hacker is hacking software with access in sensitive information from your computer​
Alina [70]
ITS TRUE!!I SEARCHED IT
7 0
1 year ago
Pressing and holding _______ while clicking enables you to select multiple contiguous files or folders.
liq [111]

Answer:

Hi LizBiz! The answer is Ctrl key on Windows, or Command key for Mac.

Explanation:

The Ctrl (Windows) key or equivalent Command key on Mac has a special purpose which allows special operations to be performed when combined with another action, such as clicking on multiple pictures or files for selection.

8 0
2 years ago
To adjust the height of cells, position the pointer over one of the dividing lines between cells. When the pointer changes to th
Sergio [31]

Answer:

double arrow shape

Explanation:

To adjust the height of the cells

1. We have to position the mouse pointer over one of the column line or the one of the row line.

2. As we place the pointer between the dividing lines, the cursor of the mouse pointer change from singe bold arrow to double arrow symbol.

3.Now press or click the left mouse button and drag the dividing lines of the   cells to the desired position to have the required width or height of the cell.

5 0
2 years ago
Other questions:
  • What is the argument in this function =AVERAGE(F3:F26)
    15·1 answer
  • George and Miguel are considering opening up a shoe store but first need to do market research. Which one of these is NOT part o
    13·2 answers
  • Darcy is creating an instructional manual for her employees. She entered the text in a word processing program and wants to impo
    6·1 answer
  • Cathy connected a keyboard, mouse, and printer to her computer through a Bluetooth connection. What type of network has she crea
    10·2 answers
  • Which of the following describes ETL? a) A process that transforms information using a common set of enterprise definitions b) A
    14·1 answer
  • You are on vacation and want to see where all the restaurants and trendy shops are in relation to your hotel. You remember there
    15·1 answer
  • Write a program to determine all pairs of positive integers, (a, b), such that a &lt; b &lt; 1000 and [a2 + b2 + 1)/(ab) is an i
    13·1 answer
  • Use the AND function with appropriate arguments in cell H11 to determine if there is a force out at third base. There is a force
    14·1 answer
  • CodeHS Python Rainforest Exercise 5.4.7: Categories
    12·1 answer
  • Consider the formula: G=D+(A+C^2)*E/(D+B)^3 Show the order that a processor would follow to calculate G. To do so, break down th
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!