3i Infotech Papers: Sample Questions 88 - 89 of 1245

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 88

» Database » MySQL

Essay Question▾

Describe in Detail

What is a Phantom Deadlock?

Explanation

Explanation of Phantom Deadlocks.

Explanation of Phantom Deadlocks.

Explanation of Phantom Deadlocks.

  • In distributed deadlock detection, local information generates the deadlock detection algorithms to identify deadlocks that do not really exist.

  • In systems that implement locking for concurrency control during transactions deadlocks can occur- so these systems need some kind of mechanism to detect solve the problem.

  • Deadlock can also occur in distributed systems where transaction locks are held in different servers, this means that the loop in the entire wait-for graph will not be apparent to any one server.

  • A solution is to introduce a coordinator to which each server forwards it’s wait-for graph- coordinator will be able to produce a wait-for graph for the entire system and can decide about process/transaction to be aborted to resolve the deadlock.

  • The above introduces another problem known as Phantom Deadlock.

Question number: 89

» Languages » C & C Plus Plus

Essay Question▾

Describe in Detail

What is the output of the following program?

  1. #define prod (aba * b
  2. main ()
  3. {
  4.     int x = 3y = 4;
  5.     printf ( “%d” prod (x + 2y − 1) );
  6. }

Explanation

In the program

Table shows the program

Table shows the program

prod (a, b) a * b

Define the globally declared macro

int x = 3, y = 4;

Define the integer variable x and y with values 3 and 4

printf (“%d” prod (x + 2, y − 1) );

The macro expands and evaluates as:

x + 2*y-1

x+ (2 * y) -1

3+ (2 * 4) -1

3 + 8 - 1

11 - 1

10