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]
3 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]3 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
You are working on a ticket for a user who cannot access the Internet from their PC. After troubleshooting, how do you confirm t
ki77a [65]
Could be anything?
Maybe you get an email from them on their PC, which means they have internet
8 0
2 years ago
You have decided to install the DNS server role on Nano Server. What specific type of zone configuration is not supported when u
nadya68 [22]

Answer:Active Directory-integrated

Explanation: Active Directory-integrated is the service that is introduced by the Microsoft .This service provides the directory form for functioning in Windows. It serves the purpose of active directory(AD) transferring to the Dynamic web database. Whenever the user gets connected to any website, it provides validation to qualifications . So, it does not get support the specification when there is working of DNS.

4 0
3 years ago
Professor Midas drives an automobile from Newark to Reno along Interstate 80. His car’s gas tank, when full, holds enough gas
zmey [24]

Answer:

The GREEDY Algorithm

Explanation:

Based on the situation given in question, the Greedy algorithm shall give the optimal solution to professor

Suppose that the cities are at locations0 =x0< x1< . . . < x

We shall use the induction method to prove that G is the optimal solution valid for numbers less than n

We assume another solution Z which we initially consider to be optimum as well, based on that when Z fills the tank, it fills it to full level

Let us state the values in case of n intervals. Given below, we say that g1 is the first stop and z1 is also the first stop.

This can be written as ;

G=g1, g2, . . . , gk

Z=z1, z2, . . . , zk’

Here k’ <= k and k < n

Let I be an idex where for the first time gi is not equal to zi

Considering t= maxi Zi

Z′=g1, z2, z3, . . . , zk′

Now since z2, z3, . . . , zk′ should be an optimal stopping pattern for the problem otherwise we have chosen Z, with smaller gas filling (not feasible)

Using induction hypothesis we conclude thatg2, . . . , gk is an optimal stopping pattern, which is based on greedy algorithm

7 0
3 years ago
PartnerServer is a Windows Server 2012 server that holds the primary copy of the PartnerNet.org domain. The server is in a demil
ella [17]

Answer:

i. True

Explanation:

A Domain Name System (DNS) can be defined as a naming database in which internet domain names (website URLs) are stored and translated into their respective internet protocol (IP) address.

This ultimately implies that, a DNS is used to connect uniform resource locator (URL) or web address with their internet protocol (IP) address.

Windows Server 2012 is a Microsoft Windows Server operating system and it was released to the general public on the 4th of September, 2012, as the sixth version of the Windows Server operating system and the Windows NT family.

PartnerServer is a Windows Server 2012 server that was designed and developed to hold the primary copy of the PartnerNet dot org domain.

Typically, the server is configured to reside in a demilitarized zone (DMZ) while providing name resolution for the domain of various Internet hosts.

In order to prevent a cyber attack on a private network, end users make use of a demilitarized zone (DMZ).

A demilitarized zone (DMZ) is a cyber security technique that interacts directly with external networks, so as to enable it protect a private network.

7 0
3 years ago
The IP address and the port are both numbers. Which statement is true?
Tema [17]

Answer:

A computer has one IP address and many ports.

Explanation:

6 0
2 years ago
Other questions:
  • Your desktop computer monitor is not displaying a picture. What would you do to troubleshoot the problem?
    7·2 answers
  • Ruby is creating a presentation. She wants each slide displayed at intervals of five seconds. Which feature in the presentation
    6·2 answers
  • To reduce chances of system failure, engineers may use _____ .
    10·2 answers
  • Implication of technological literacy to a teacher training today
    13·1 answer
  • Which of the following is one of the options available on the Columns menu on the
    6·1 answer
  • Missy loves her old Windows games. When she upgrades her Windows system, the games run fine, but the output looks fuzzy since th
    15·1 answer
  • Which examples demonstrate common education and qualifications for Manufacturing Production Process Development careers? Check a
    12·2 answers
  • Which of these skills are used in game design?
    8·1 answer
  • What is the reason for taking care of design a good computer human interface ​
    9·2 answers
  • Firestick optimizing system storage and applications loop
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!