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
Travka [436]
4 years ago
14

Race conditions are possible in many computer systems. Consider a banking system with two methods: deposit(amount) and withdraw(

amount). These two methods are passed the amount that is to be deposited or withdrawn from a bank account. Assume that a husband and wife share a bank account and that concurrently the husband calls the withdraw() method 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:
Fittoniya [83]4 years ago
4 0

Answer:

Race Condition is possible if husband and wife both have concurrent functionality.

Explanation:

For eg. if Balance = 3000 and husband withdraws = 1000 then remaining balance is = 2000.

One the other hand if balance is 3000 and wife deposits =1000 then remaining balance is 4000

we can see that there is inconsistency that is not acceptable.

To solve the problem mostly we are using Peterson's Algorithm

Account can be used for husband and wife,

int flag = 0

boolean account

1 :Husband

do{

account[i] =TRUE;

flag=(i+1)%2

while (account [(i+1)%2] && turn =(i+1)%2;

withdraw();

account[i] = FALSE

(remainder)

} While (TRUE);

This process can be repeat with (Wife)  where i will be replaced by j ,i=0 or 1 and j =1 or 0

  • flag identify which is going to access the bank account
  • account make sire that 2 users are mutually exclusive

Proved the race condition is prevented

You might be interested in
Encoding in the information processing theory is the process of _____
Katyanochek1 [597]

Encoding in the information processing theory is the process of inputting of information into the memory system.

<h3>What is encoding?</h3>

Encoding is an act or a system method that is used in the inputting of information into the computer memory system.

It entails the storage in the retention of encoded information. After encoding is the Retrieval method that is the act of getting the information out of memory.

Learn more about encoding from

brainly.com/question/3926211

8 0
2 years ago
7+9 help me pleas i dont know help now
natali 33 [55]

Answer:

16

Explanation:

because it is

4 0
2 years ago
Read 2 more answers
How would you cite the following source according to APA guidelines?
PSYCHO15rus [73]

B.Merriam-Webster's collegiate dictionary (10th ed.). (1993). Springfield, MA: Merriam-Webster.

In general, APA citations follow the format of;

<u>Contributors.(Date).Title. Publication Information</u>.  However, when there is no contributor information, write the name of the title first, followed by the date and the rest of the bibliographic data.



7 0
3 years ago
Read 2 more answers
Rijndael, AES, CCMP are same as well as different. They are same in terms of how encryption is done and different in terms of wh
worty [1.4K]

Answer:

Option (b) is the correct answer to this question.

Explanation:

AES is based on Rijndael Algorithm.

The Rijndael algorithm enables a choice of block sizes and key sizes. The choices are for each of 128, 192, or 256 bits. Once NIST implemented Rijndael for AES, it only specified one block size,128 bits, but maintained three major lengths of selection. IEEE 802.11I go a step and further limits when both the main size and length of the block for 128 bits. It simplifies deployment and relieves users during development from having to make yet again another decision.

Other options are incorrect because they are not related to the given scenario.

8 0
3 years ago
Programmers use _____ languages in the Rapid Application Development (RAD) methodology to facilitate code reuse?
photoshop1234 [79]
The Go programming language
8 0
3 years ago
Other questions:
  • Which technology uses regular phone lines and transmits at speeds up to 256 kbps?
    15·2 answers
  • What is a different paragph formatting tools
    6·1 answer
  • The ____ of a variable is the location in memory where it’s value is stored. A. Value B. Address C. Data type D. Number
    8·1 answer
  • . Why did the designers of the Synchronous Digital Hierarchy choose unusual values for data rates instead of the exact powers of
    11·1 answer
  • 50 POINTS &amp; A FOLLOW!
    11·2 answers
  • Which of the following is not a reserved keyword in python?​
    13·1 answer
  • A web feed:
    7·2 answers
  • Please tell fast plzzzzzz. ​
    10·2 answers
  • How does communication produce clarity and direction​
    13·1 answer
  • 4.8.4 Better Sum
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!