2015Q1a --- 1. (50P) In a game about traffic running on a single processor system, there are three different tasks: car, pedestrian and traffic lights. Traffic lights are automatically bring out their duties. Cars and pedestrians, when come across with traffic lights, according to lights, stops or continues to their act. And they wait until outside user enter the new direction when come to the junctions. Accordingly, write down the benefits of performing these three tasks at only the user-level, only the kernel-level or hybrid threading. - Using only user-level threading; Because time of overheads are short, this method can be better for compute-bound threads like traffic lambs. But we know that it is not so much good for I/O bound threads. Using only kernel-level threading; Two (cars and pedestrians) of three tasks can use I/O interrupts. For this reason, threads of these tasks should be created at kernel-level. Thus I/O blocking cannot affect irrelevant threads. Using hybrid threading; At first we can describe three kernel-level threading for each task. Then each compute-bound thread like traffic lambs can create new user-level threads for each instant of traffic lambs. Thus, both managing the I/O blockings and reduction of overheads gets better. --- 2. (50P) Consider that there are three separate processes for three tasks mentioned in the above question. During parallel operation of these processes, when and why does process states change? Explain. - In a single processor system, at any time, only one process can be in running state. And that process is decided by scheduler system. Since we know that traffic lamb task is compute–bound, that process will never go to blocked state because of user based I/O interrupts. But when it’s running time finishes, it must go to ready state. This is available for the others. On the other hands, processes using I/O interrupt like car and pedestrian can go in blocked state. When I/O input completes, these processes goes to ready state by entering the running queue. --- 2015Q1b --- 1. (50P) In a simulation on first aid running on a single processor system, there are three different tasks: fire-fighting, ambulance, and police. All of these tasks have “functions encoded” which automatically (without asking any information from the user) fulfill their works. Accordingly, write down the benefits of performing these three tasks at only the user-level, only the kernel-level or hybrid threading. - Using only user-level threading; We know all of the tasks are compute-bound, for this reason we can benefit user-level threading because of its performance. Thus we can say that this is the best implementation for this problem. Using only kernel-level threading; Even though there is no task using any user based I/O interrupt, some processes can use disk which also needs a kind of I/O interrupt. If this kind of procedures are used too much, then creating these tasks at kernel-level can be better. Using hybrid threading; According to problem, there cannot be user based I/O request. Therefore, at first look, we can think that hybrid threading may not help. But if too much disk usage is possible in tasks, then describing kernel-level threads for each task and user-level threads for instant creations can be useful. --- 2. (50P) Consider that there are three separate processes for three tasks mentioned in the above question. During parallel operation of these processes, when and why does process states change? Explain. - In a single processor system, at any time, only one process can be in running state. And that process is decided by scheduler system. Since we know that all tasks are compute-bound, that process will never go to blocked state because of user based I/O interrupts. But when it’s running time finishes, it must go to ready state. This is available for the others. On the other hands, if the processes can use disk based I/O interrupts, they can go in blocked state. When I/O input completes, these processes goes to ready state by entering the running queue. ---