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
andrey2020 [161]
3 years ago
9

Consider a system consisting of m resources of the same type, being shared by n processes. Resources can be requested and releas

ed by processes only one at a time. Show that the system is deadlock free if the following two conditions hold:__________.
A. The maximum need of each process is between 1 and m resources
B. The sum of all maximum needs is less than m+n.
Computers and Technology
1 answer:
Mama L [17]3 years ago
5 0

Answer:

Explanation:

The system will be deadlock free if the below two conditions holds :

Proof below:

Suppose N = Summation of all Need(i), A = Addition of all Allocation(i), M = Addition of all Max(i). Use contradiction to prove.

Suppose this system isn't deadlock free. If a deadlock state exists, then A = m due to the fact that there's only one kind of resource and resources can be requested and released only one at a time.

Condition B, N + A equals M < m + n. Equals N + m < m + n. And we get N < n. It means that at least one process i that Need(i) = 0.

Condition A, Pi can let out at least 1 resource. So there will be n-1 processes sharing m resources now, Condition a and b still hold. In respect to the argument, No process will wait forever or permanently, so there's no deadlock.

You might be interested in
Fill in the blanks to make the factorial function return the factorial of n. Then, print the first 10 factorials (from 0 to 9) w
nadezda [96]

Answer:

Following are code of factorial in python language

def factorial(n): # function

   result=1 #variable

   for x in range(2,n+1): #iterating the loop

       result=result*x  #storing result

   return result #return result

for n in range(10): #iterating loop

   print(n,factorial(n)) #print factorial

Output:

Following are the attachment of output

Explanation:

Missing information :

In the question the information is missing the code is missing which we have to correct it following are the code that are mention below.

def factorial(n): # function

   result=1 #variable

   for x in range(       ): #iterating the loop

       result=  #storing result

   return  #return result

for n in range(  ): #iterating loop

   print(n,factorial(n)) #print factorial

Following are the description of code

  • We have create a function factorial  in this we have pass the one parameter i.e "n".
  • In the for loop we have pass 2,n+1 which has been used to iterating the loop calculating factorial and string the result in the result variable
  • In the main function we have pass the range on which we have to calculated the factorial
  • Finally the print function will print the factorial .

Following are the attachment snip of code in the python language

3 0
3 years ago
Creative Commons Question -- At home, you created a really great digital song, audio jingle, or music track using some software
galina1969 [7]
C. It's honestly up to the user, upload so others can use it or make it so its copyrighted and make some cash :P
6 0
2 years ago
Create a program that includes a function called toUpperCamelCase that takes a string (consisting of lowercase words and spaces)
astraxan [27]

Answer:

#include<iostream>

using namespace std;

//method to remove the spaces and convert the first character of each word to uppercase

string

toUpperCameICase (string str)

{

string result;

int i, j;

//loop will continue till end

for (i = 0, j = 0; str[i] != '\0'; i++)

{

 if (i == 0)       //condition to convert the first character into uppercase

  {

  if (str[i] >= 'a' && str[i] <= 'z')   //condition for lowercase

  str[i] = str[i] - 32;   //convert to uppercase

  }

if (str[i] == ' ')   //condition for space

  if (str[i + 1] >= 'a' && str[i + 1] <= 'z')   //condition to check whether the character after space is lowercase or not

  str[i + 1] = str[i + 1] - 32;   //convert into uppercase

if (str[i] != ' ')   //condition for non sppace character

  {

  result = result + str[i];   //append the non space character into string

  }

}

//return the string

return (result);

}

//driver program

int main ()

{

string str;

char ch;

//infinite loop

while (1)

{

fflush (stdin);

//cout<< endl;

getline (cin, str);   //read the string

//print the result

//cout<< endl << "Q";

// cin >> ch; //ask user to continue or not

ch = str[0];

if (ch == 'q' || ch == 'Q')   //is user will enter Q then terminatethe loop

  break;

cout << toUpperCameICase (str);

cout << endl;

}

return 0;

}

8 0
3 years ago
Which of the following is NOT true about a flow chart?
SCORPION-xisa [38]
I think the answer is A
4 0
3 years ago
The average pH of citrus fruits is 2.2, and this value has been stored in the variable avg_citrus_pH . Provide a statement to di
olasank [31]

Answer:

The statement in Python is:

print("The average pH of citrus fruits is ",avg_citrus_pH)

Java

System.out.print("The average pH of citrus fruits is "+avg_citrus_pH);

C++

cout<<"The average pH of citrus fruits is "<<avg_citrus_pH;

Explanation:

The programming language is not stated; so, I answered the question in 3 languages (Python, Java and C++)

Assume that avg_citrus_pH has been declared and initialized; all you need to do is invoke a print statement and then append the variable

In Python, use print()

In c++, use cout<<

In Java, use System.out.print()

So, the statements are:

Python:

print("The average pH of citrus fruits is ",avg_citrus_pH)

Java

System.out.print("The average pH of citrus fruits is "+avg_citrus_pH);

C++

cout<<"The average pH of citrus fruits is "<<avg_citrus_pH;

8 0
2 years ago
Other questions:
  • Which sentence best describes an activity stream?
    10·2 answers
  • While designing web pages for mobiles, the page content should be extensive such that the readers get the opportunity to explore
    5·2 answers
  • Identify the four basic categories of hardware in a microcomputer system. system unit, modem, ram, and microprocessor system uni
    5·1 answer
  • Fill in the blank: _________ is Google’s machine-learning artificial intelligence system that interprets people’s searches to fi
    9·1 answer
  • Bruh my sister does bot understand what this means
    6·1 answer
  • What is adobe photoshop?
    10·2 answers
  • Select the correct answer.
    15·1 answer
  • When does the following while-loop stop running?
    10·1 answer
  • 8.5 Edhesive Code Practice
    14·1 answer
  • Write a short note on Ms - Excel...​..
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!