Answer:
An error will be occurred here. In C++ a function must be like
returntype function_name(){
}
but the functions in given class does not have returntype given. So there will be a syntax error.
If the returntype is defined then the code does not show any output since nothing is printed in the main function.
Answer:
a.) UDP does not include data reassembly.
It can help you more be aware of whats going on and what you need to do.
The answer is 9
Hope I helped you
Answer:
a) 4 processes
b) 2 resources
c) R1: 2 instances
R2: 2 instances
d) R2
e) R1
f) R1
g) No resource
h) R1
i) R2
j) R2
k) No
l)No deadlock
Explanation:
You need to know that the resources that are required by the processes for completion are shown by the request edge and the resources allocated are shown by the allocation edge. And thus, we can find what resources are allocated to the process, and required for the completion accordingly. And here again, the cycle is created, and hence deadlock may or may not occur. However, we see that resources have multiple instances and get freed on time. And hence, deadlock does not occur.
Like,
P4 uses R2 and free one instance of R2.
P3 then uses one instance of R2 and free R2.
P3 then uses one instance of R3 and free R3.
P1 uses one instance of R1 and free R1 one instance
P1 then uses R2 and free R2.
P2 uses R1 and free R1.
Hence, all the processes are complete and deadlock does not occur.