Chapter 3

From Computer Club Wiki

Jump to: navigation, search

Study Guide

  • 3.1Palm OS provides no means of concurrent processing. Discuss three major complications that concurrent processing adds to an operating system.

Processes may affect each other's behavior through shared data, shared resources, communication, and synchronization.

Scheduling Resource allocation Protection of processes from the other processes

  • 3.2The Sun UltraSPARC processor had multiple register sets. Describe what happens when a context switch occurs if the new context is already loaded into one of the register sets. What happens if the new context is in memory rather than in a register set and all the register sets are in use?

If it is already loaded into one of the registers, then the system will just change the pointer to the new register, leaving the old one alone. If the new one is in memory, it is copied into the register as other systems do, and if all the registers are full, then it will copy one of the registers into memory and load the new one into the register.

  • 3.3When a process creates a new process using the fork() operation which of the following states is shared between the parent process and the child process?

a. Stack b. Heap (c.) Shared memory segments It gets certain resources, privileges, and scheduling, such as open files.

  • 3.4With respect to the RPC mechanism, consider the “exactly once” semantic. Does the algorithm for implementing this semantic execute correctly even of the ACK message back to the client is lost due to a network problem? Describe the sequence of messages and discuss whether “exactly once” is still preserved.

It should. Since it is still using the “at most once” method, the sender is going to keep sending requests to execute the command. If the ACK message is lost, the sender keeps sending the request. The server will notice that the request was already received and should send an ACK message back to acknowledge that.

  • 3.5Assume that a distributed system is susceptible to server failure. What mechanisms would be required to guarantee the “exactly once” semantic for execution of RPCs?

Wouldn’t it just need to keep a record of the RPCs that it had completed so that when communication was restored it could just tell the sender what it had done?

  • 3.6Describe the differences between short-term, medium-term, and long-term scheduling.

The short-range scheduler takes the processes that are ready to run and gives them the CPU. It runs frequently ~10ms The long-term scheduler takes the processes from storage and loads them into memory for execution. It runs infrequently, minutes. Or when a process is closed. The medium term scheduler swaps the processes out of memory to allow more efficiency for the CPU. These processes can then be swapped back in to complete execution.

  • 3.7Describe the actions taken by the kernel to context-switch between processes.

Other than saving the context of the old process in the PCB and loading the new process, I don’t know what else it would do. I suppose that it could also change pointer locations and move register data to and from memory.

  • 3.8Construct a process tree similar to Figure 3.9. To obtain process information for the UNIX or Linux system, use the command ps –ael. Use the command man ps to get more information about the ps command. On Windows systems, you will have to use the task manager.

NO.

  • 3.9Including the initial parent process, how many processes are created by the program shown in Figure 3.28?

I’m going to guess 7.

  • 3.10Using the program in Figure 3.29, identify the values of pid at lines A, B, C, and D. (Assume the pids of the parent and child are 2600 and 2603, respectively.)

0,2603,2603,2600

  • 3.11Give an example of a situation in which ordinary pipes are more suitable than named pipes and an example of a situation in which named pipes are more suitable than ordinary pipes.

Ordinary pipes are useful when parent and children processes want to talk to each other. Since they have access to the pipes that the parent creates, they can communicate. They are also useful for sending data both ways. Named pipes are useful when different processes are communicating between each other. Since they don’t have access to the same memory, they create space where they can both talk. Named pipes, however, can only talk one way, so they have to create 2 if they both want to speak.

  • 3.12Consider the RPC mechanism. Describe the undesirable consequences that could arise from not enforcing either the “at most once” or “exactly once” semantic. Describe possible uses for a mechanism that has neither of these guarantees.

Well, if data is lost during transmission, then the receiver wont know if it has something to do or not. I believe that we discussed this and said something about the internet is set up in this way.

  • 3.13Using the program shown in Figure 3.30, explain what the output will be at line A.

Should be 20. The child should execute first, but it probably didn’t…

  • 3.14What are the benefits and the disadvantages of each of the following? Consider both the system level and the programmer level.

a. Synchronous and asynchronous communication b. Automatic and explicit buffering c. Send by copy and send by reference d. Fixed-sized and variable-sized messages


Study Guide

Personal tools