A server process maintains a shared information object such as the BLOB object of Exercise 1.7. Give arguments for and against allowing the client requests to be executed concurrently by the server. In the case that they are executed concurrently, give an example of possible ‘interference’ that can occur between the operations of different clients. Suggest how such interference may be prevented.
What will be an ideal response?
For concurrent executions - more throughput in the server (particularly if the server has to access a disk or
another service)
Against - problems of interference between concurrent operations
Example:
Client A’s thread reads value of variable X
Client B’s thread reads value of variable X
Client A’s thread adds 1 to its value and stores the result in X
Client B’s thread subtracts 1 from its value and stores the result in X
Result: X := X-1; imagine that X is the balance of a bank account, and clients A and B are implementing credit
and debit transactions, and you can see immediately that the result is incorrect.
To overcome interference use some form of concurrency control. For example, for a Java server use
synchronized operations such as credit and debit.
You might also like to view...
Each SQL Server error message is assigned a numerical _________ level that describes the type of error.
Fill in the blank(s) with the appropriate word(s).
What is the output of the following code?
``` public class Test { public static void main(String[] args) { int[][][] data = {{{1, 2}, {3, 4}}, {{5, 6}, {7, 8}}}; System.out.print(ttt(data[0])); } public static int ttt(int[][] m) { int v = m[0][0]; for (int i = 0; i < m.length; i++) for (int j = 0; j < m[i].length; j++) if (v < m[i][j]) v = m[i][j]; return v; } }``` a. 1 b. 2 c. 4 d. 5 e. 6
What is a pixel?
What will be an ideal response?
Flash displays a(n) ____________________ at the top of the document window that shows the name of the file and a Close button.
Fill in the blank(s) with the appropriate word(s).