Encrypting your link and protect the link from viruses, malware, thief, etc! Made your link safe to visit.

 -> currently available resources

R0   R1   R2   R3

0      1      2      2

-> At this situation only process P1 get resources for its task completion because it still needs resources

R0   R1   R2   R3

0      0      2      0

which resources are available.So first Process P1 completes its task and then releases its resources after task completion.

-> next available resources

R0 R1    R2 R3

0+2     1+0      2+1      2+0

i.e

available resources

R0   R1    R2 R3

2     1      3      2

-> At this situation only process P4 get resources for its task completion because it still needs resources

R0   R1   R2   R3

2      0      0      2

which resources are available.So next Process P4 completes its task and then releases its resources after task completion.

-> now available resources

R0    R1    R2    R3

2+4     1+3 3+5       2+2

i.e

available total resources

R0   R1    R2 R3

6       4       8       4

-> At this situation only process P5 get resources for its task completion because it still needs resources

R0   R1   R2   R3

0     3      2      0

which resources are available.So next Process P5 completes its task and then releases its resources after task completion.

-> now available resources

R0    R1    R2    R3

6+2       4+3       8+3       4+0

i.e

available total resources

R0   R1    R2 R3

8       7     11       4

-> still the order of processes execution is P1->P4->P5

-> At this situation only process P2 get resources for its task completion because it still needs resources

R0   R1   R2   R3

0      7      5      0

which resources are available.So next Process P5 completes its task and then releases its resources after task completion.

-> now available resources

R0    R1    R2    R3

8+0       7+0     11+0       4+2

i.e

available total resources

R0   R1    R2 R3

8       7     11       6

-> finally P3 got all resources to complete its task.after completion of process P3 ...total avialble resources are

R0   R1    R2    R3

12      7     14       6

=> Execution Order is :    P1->P4->P5->P2->P3

--------> if request from a process P1 arrives for (0, 4, 2, 0) at initial situation .the request can't be granted immediately,because avialable resources are less than required resources.So P1 doesnt granted immediately.

iii) If a request from a process P2 arrives for (0, 1, 2, 0) ...the request immediately granted because avialable resources are greater than required resources.

then Execution order is : P2 -> P1 -> P4 -> P5 -> P3 (similarily as above)

ST

Search This Blog

Labels

Report Abuse

A palindrome is a number or a text phrase that reads the same backwards as forwards. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 45554 and 11611. Write a C++ program that reads in a five-digit integer and determines whether it is a palindrome .

Question: A palindrome is a number or a text phrase that reads the same backwards as forwards. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 45554 and 11611. Write a C++ program that reads in a five-digit integer and determines whether it is a palindrome . Answer: Step 1 PROGRAMING CODE:   #include <stdio.h> int main() {   int n, a, b, c, d, e;   int digit = 0;   printf( "Enter one 5 digit number: \n" );   scanf( "%d", &n );   a = n / 10000;   b = n / 1000 % 10;   c = n / 100 % 10;   d = n / 10 % 10;   e = n % 10;   if ( a == e && b == d ) {     printf( "Palindrome!\n" );   }   if ( a != e || b != d ) {     printf( "Not a palindrome.. :(\n" );   }   return 0; } PROGRAM SCREENSHOT: Step 2

QUESTION 6 (a) The bar shown in Figure Q2(a) is subjected to tensile load of 150 Kn. If the stress in the middle portions is limited to 160 N/mm², determine the diameter of the middle portion. Find also the length of the middle portion if the total elongation of the bar is to be 0.25 mm. E E = 2.0 + 105N/mm². (12 marks) 150 KN 10 cm DIA 10 cm DIA 150 KN 45 cm Figure Q6(a) (b) A brass bar, having cross-section area of 900 mm², is subjected to axial forces as shown in Figure Q2(b), in which AB = 0.6 m, BC = 0.8 m, and CD = 1.0 m. Find the total elongation of the bar. E = 1.0 + 105N/mm2 . (8 marks) Page 4 of 5 B D 40 KN 70 KN 20 KN 10 KN Figure Q6(b) (TOTAL = 20 MARKS)

  Question: Show transcribed image text Answer:

Contributors