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
Ahat [919]
3 years ago
12

One condition for deadlocks is the circular-wait condition. One way to ensure that this condition never holds is to impose a tot

al ordering of all resource types and to require that each process requests resources in increasing order of enumeration. Given an example of a bank transaction, is deadlock possible for this case
Computers and Technology
2 answers:
Artyom0805 [142]3 years ago
4 0
<h2>Dead lock is possible in Bank Transactions</h2>

Explanation:

Let us understand the term "Dead lock"

A deadlock is a situation where whole set of process is locked, since each of the process is waiting or holding the resource of another process. Each process will be interdependent and waiting for the same resource.

Deadlock is possible during bank transaction in the following situation:

A & B are two accounts where A tries to transfer funds to B and B tries to transfer fund to A.

When both tries to transfer funds at the same time, deadlock occurs.

A deadlock can be avoided by any one of the four methods.

They are: Mutual exclusion, No preemption, circular wait, hold and wait.

ira [324]3 years ago
3 0

<u>A deadlock</u><u> refers to a situation in which two computer program that shares the same resource/data  are  preventing each other from accessing the resource/data , resulting in both programs ceasing to function.</u>

<u />

Explanation:

A deadlock refers to a situation in which  the whole  process is locked, since each of the process is waiting or holding the resource of another process. The two process are interdependent on each other and cannot function independently

<u>An example of Deadlock occurring  during a bank transaction is   </u>

<u />

Lets consider two bank accounts of customer X & Customer Y

Now if  customer X  tries to transfer funds to Customer Y or Y tries to transfer fund to X ,when these 2 process occur simultaneously at the same time a deadlock is said to have occur

You might be interested in
what is the name of the fields in an x.509 digital certificate that are used when the parties negotiate a secure connection?
Zigmanuir [339]

Answer:

Image result for what is the name of the fields in an x.509 digital certificate that are used when the parties negotiate a secure connection?

Common applications of X. 509 certificates include SSL/TLS and HTTPS for authenticated and encrypted web browsing, signed and encrypted email via the S/MIME protocol, code signing, document signing, client authentication, and government-issued electronic ID.

Explanation:

8 0
3 years ago
Suppose you have two arrays of ints, arr1 and arr2, each containing ints that are sorted in ascending order. Write a static meth
telo118 [61]
Since both arrays are already sorted, that means that the first int of one of the arrays will be smaller than all the ints that come after it in the same array. We also know that if the first int of arr1 is smaller than the first int of arr2, then by the same logic, the first int of arr1 is smaller than all the ints in arr2 since arr2 is also sorted.

public static int[] merge(int[] arr1, int[] arr2) {
int i = 0; //current index of arr1
int j = 0; //current index of arr2
int[] result = new int[arr1.length+arr2.length]
while(i < arr1.length && j < arr2.length) {
result[i+j] = Math.min(arr1[i], arr2[j]);
if(arr1[i] < arr2[j]) {
i++;
} else {
j++;
}
}
boolean isArr1 = i+1 < arr1.length;
for(int index = isArr1 ? i : j; index < isArr1 ? arr1.length : arr2.length; index++) {
result[i+j+index] = isArr1 ? arr1[index] : arr2[index]
}
return result;
}


So this implementation is kind of confusing, but it's the first way I thought to do it so I ran with it. There is probably an easier way, but that's the beauty of programming.

A quick explanation:

We first loop through the arrays comparing the first elements of each array, adding whichever is the smallest to the result array. Each time we do so, we increment the index value (i or j) for the array that had the smaller number. Now the next time we are comparing the NEXT element in that array to the PREVIOUS element of the other array. We do this until we reach the end of either arr1 or arr2 so that we don't get an out of bounds exception.

The second step in our method is to tack on the remaining integers to the resulting array. We need to do this because when we reach the end of one array, there will still be at least one more integer in the other array. The boolean isArr1 is telling us whether arr1 is the array with leftovers. If so, we loop through the remaining indices of arr1 and add them to the result. Otherwise, we do the same for arr2. All of this is done using ternary operations to determine which array to use, but if we wanted to we could split the code into two for loops using an if statement.


4 0
3 years ago
What kind of resources can we share over the network? Plzzzzzzzz help!!!!!!
lubasha [3.4K]

Sharing network resources requires abiding by certain constraints, as follows:

<span>Security: Organizations present ongoing opportunities for unauthorized shared resources. Security mechanisms should be implemented to provide efficient parameters.Compatibility: Various client-server operating systems may be installed, but the client must have a compatible OS or application to access shared resources. Otherwise, the client may encounter issues that create communication delays and requires troubleshooting.Mapping: Any shared OS hardware drive, file or resource may be accessed via mapping, which requires a shared destination address and naming conventions.<span>File Transfer Protocol (FTP) and File Sharing: FTP is not affected by shared resources because the Internet is FTP’s backbone. File sharing is an LAN concept.</span></span>
3 0
3 years ago
Read 2 more answers
Given an array temps of double s, containing temperature data, compute the average temperature. Store the average in a variable
Ket [755]

Answer:

#include <iostream>

using namespace std;

// average function

void average(double arr[], int n) {

double total = 0;

double avgTemp;

for (int i = 0; i < n; i++)

{

 // find temperatures total

 total = total + arr[i];

}

// find average

avgTemp = total / n;

cout << "\nAverage Temperature = " << avgTemp << endl;

}

// print temps[] array

void printArray(double arr[], int n) {

for (int i = 0; i < n; i++)

{

 cout << arr[i] << "   ";

}

}

int main() {

int const k = 5;

double temps[k];

// temperature value

double tempValue;  

// Enter 5 temperatures of your choice

for (int i = 0; i < k; i++)

{

 cout << "Enter Temperature value " << i+1 << ": ";

 cin >> tempValue;

 temps[i] = tempValue;

}

// Function call to print temps[] array

printArray(temps, k);  

// Function call to print average of given teperatures

average(temps, k);        

return 0;

}

Explanation:

• Inside main(), int constant k is created to set the maximum size of array temps[].

• tempValue of  type double takes value at a given index of our temps[] array.

• the for loop inside main() is used to get tempValue from the user and store those values in our array temps[].

• after that printArray() function is called. to pass an array to a function it requires to perimeters 1) name of the array which is temps in our case. 2) maximum number of the index which is  k.

• note the syntax of void average(double arr[], int n). Since we are passing an array to the function so its formal parameters would be arr[] and an int n which specifies the maximum size of our array temps[].

6 0
3 years ago
All of the following are examples of extracurricular activities except:
mart [117]
A, because normally that would be a requirment
8 0
3 years ago
Read 2 more answers
Other questions:
  • Informs the network interface card to pass packets sent to that address to the ip stack so their contents can be read, and tells
    9·1 answer
  • Kyra needs help planning what images and text to use in her web page what technique can help her
    5·2 answers
  • What is a Photojournalist
    5·1 answer
  • Given the strings s1 and s2 that are of the same length, create a new string consisting of the last character of s1 followed by
    10·1 answer
  • Lydia noticed that she feels tired and out of breath after walking her dog up a hill in the park. Which area of fitness does she
    8·1 answer
  • PLEASE HELP ASAP!!!
    8·1 answer
  • Which of the following “invisible” marks represents an inserted tab?
    11·2 answers
  • A desktop computer is a type of mobile device.<br><br> a. true<br> b. false
    5·1 answer
  • Which type of file can be opened directly into Excel?
    15·1 answer
  • The classes Person and Airplane shall have the property to print information about themselves on a printer. Draw class and inter
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!