TO-DO

EXAMPLES OF IPC SYSTEMS communication in client - server systems

Solution

3.1

        As fork basically creates a duplicate of current process, identical in almost very way except a few. As it as a different pid, and parent pid. But idea is to create as identical copy as possible. Hence copy of variables, stack and heap, are created. Hence child process variable and parent process variable are now different. So ans is 5.

3.2

        8

3.3

        There is a lot of complications that occurs :-

  1. How to effectively share resources among different process.

  2. How to effectively allow access to shared memory without different process accessing same location simultaneously.

  3. Prevention of deadlocks.

3.4

        If the new context in already in register set space, then CPU current context pointer changes to register corresponding to new context.

But if new context is in memory space and all register in register set are full then, one of the register in register set is chossen and its data is saved in memory and new context is loaded in this choosen register.

3.5

        As mentioned in problem 1, child process create its own copy of stack and heap. But shared memory is shared between child and parent process.

Because the way shared memory is implemented is that shared memory space is mapped to current process address space ( using a pointer to starting of shared memory state ) and when current process forks, child process tries to duplicate parent process address space, getting the same mapping. (pointer)

3.6

        To do

3.7

        To do left

3.8

       

  1. Short-term scheduling :- This scheduling select which process from the ready queue should be selected now in order of have most efficient system. This is called frequently and thus should be very fast.

  2. Long-term scheduling :- This scheduling algo. selects process waiting to be executed and load them into memory(ready queue). This controls the degree of multi-programming (number of process in ready queue).

  3. Medium-term scheduling :- Many times it is better to remove a process from memory and hold it’s execution and later put it back in the memory.