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
Vsevolod [243]
2 years ago
11

In Section 8.5.4, we described a situation in which we prevent deadlock by ensuring that all locks are acquired in a certain ord

er. However, we also point out that deadlock is possible in this situation if two threads simultaneously invoke the transaction () function. Fix the transaction () function to prevent deadlocks.
Computers and Technology
1 answer:
ruslelena [56]2 years ago
4 0

Answer:

See Explaination

Explanation:

Separating this critical section into two sections:

void transaction(Account from, Account to, double amount)

{

Semaphore lock1, lock2;

lock1 = getLock(from);

lock2 = getLock(to);

wait(lock1);

withdraw(from, amount);

signal(lock1);

wait(lock2);

deposit(to, amount);

signal(lock2);

}

will be the best solution in the real world, because separating this critical section doesn't lead to any unwanted state between them (that is, there will never be a situation, where there is more money withdrawn, than it is possible).

The simple solution to leave the critical section in one piece, is to ensure that lock order is the same in all transactions. In this case you can sort the locks and choose the smaller one for locking first.

You might be interested in
How did josh norman and mike keller provide coverage of katrina?
Digiron [165]
<span>They wrote live updates to a blog, so D. The blog was called "Eye of the Storm." It was written as a series of personal musings and photographs of places where the storm hit- first hand accounts of the disaster. They received a journalism award for it.</span>
6 0
2 years ago
Read 2 more answers
________ is the process of converting a poorly-structured table into two or more well-structured tables. optimization normalizat
bulgar [2K]

Answer:

Normalization

Explanation:

Converting a poorly-structured table and optimizing its database structure in order to reduce redundancy in relations can be referred to as database normalization. If the data is not redundant means that data inconsistencies and errors like deletion and insertion will get reduced or eliminated significantly.

4 0
2 years ago
Splunk In most production environments, _______ will be used as the source of data input?
Wittaler [7]

Answer: Forwarders

Explanation:

Splunk is defined as the software technology which helps in organization of applications, examining and monitoring of the data and information analytics.It performs the operation of indexing, processing and gathering to produce graphs, alert ,report etc .

  • Forwarders are the component of Splunk software that gathers the information and transmit it to the Splunk clod for further analysis and processing .It is considered as the reliable method for input of data.

6 0
2 years ago
Which of the following is not true of how computers represent complex information
mote1985 [20]

Answer: c. Depending on context the same sequence of bits may represent different types of information.

Explanation:

The options for the question are:

A. Computing devices use patterns of bits to represent complex information

B. Abstraction helps represent complex information by surfacing complexity that might otherwise be hidden

C. Depending on context the same sequence of bits may represent different types of information

D. Common abstractions that are represented by computing devices include numbers, characters, and color.

The following are true of how computers represent complex information:

• Computing devices use patterns of bits to represent complex information

• helps represent complex information by surfacing complexity that might otherwise be hidden

• Common abstractions that are represented by computing devices include numbers, characters, and color.

Therefore, the option that is not true of how computers represent complex information is that "depending on context the same sequence of bits may represent different types of information".

5 0
1 year ago
Read 2 more answers
Which organization supports professionals who assist families in making informed choices about products and services?
Naily [24]
The organisation that would best aid families and choose the right products to buy would be the American Association of Family and Consumer Sciences. In addition, the institution is primarily composed of home economists wherein these professionals promote efficient consumer consumption of goods.
6 0
2 years ago
Read 2 more answers
Other questions:
  • A search box does all of the following EXCEPT ________.
    12·2 answers
  • When preparing a spreadsheet that contains population data for different nations, what is the best way to provide a visual compa
    12·2 answers
  • Lucas put a lot of thought into the design for his company's new white paper. He made sure to include repeating design elements
    13·2 answers
  • Write a script that prints the multiples of 7 between 0 and 100. Print one multiple per line and avoid printing any numbers that
    14·1 answer
  • Our new catalog contains an eclectic collection of items
    6·1 answer
  • Assume you have a variable, budget, that is associated with a positive integer. Assume you have another variable, shopping_list,
    11·1 answer
  • CHALLENGE ACTIVITY 3.7.2: Type casting: Reading and adding values.
    10·1 answer
  • Write an expression to print each price in stock prices.
    15·1 answer
  • You would use the _______ conditional formatting options when analyzing a worksheet in which you want to highlight the highest o
    13·1 answer
  • Ryan has made a presentation of ten slides, which he wants to display in sequence after a specific time interval. Which element
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!