- This lab was focused on:
- Introduction to Linux env and get to know how the file system works.
- Creating object file and Linking object files
- Merging two files into a third using read and write system calls.
- This lab was focused on:
- Fork system call. Creating both a given and arbitrary proccess tree.
- Sending/Handling signals so as the messages of the arbitrary proccess tree are shown in depth.
- Parallel calculation of numerical expression given in a form of an arbitrary proccess tree. Every node is either + or * and every leaf is a number. Pipes was used for the implementation.
- This lab was focused on:
- Sync - locks vs atomic operations.
- Parallel calculation of the Mandelbrot set. See the difference between using more threads each time.
-
This lab was focused on:
- Creating a round-robin scheduler. The scheduler is a parent proccess in the user space, distributing computational time in child processes. In order to control the processes, the scheduler will use the SIGSTOP and SIGCONT signals to stop and activate each process, respectively. Every proccess is being executed for a period of time equal to tq. If the proccess is terminated before the time equal to tq, the scheduler removes the proccess from the queue and activates the next one. If the time quantum is been reached and the proccess won't finish, the proccess terminates, its been placed to the end of the queue and the next proccess is been activated. The operation of the scheduler is required to be asynchronous based on signals. The scheduler will be using the SIGALRM (when the time quantum is reached the scheduler stops the current proccess) and SIGCHLD (pause or terminate the proccess) signals. Every proccess has its own id. The scheduler shows relevant messages at activation/pause/termination of a proccess. When all the proccesses are finished, the scheduler also terminates.
Execution of the scheduler:
./scheduler prog prog prog prog
- Operation check of the scheduler through shell. Extending the previous code we need to support the control of the operations of the scheduler through the shell. The user must be able to request dynamic creation and termination of proccesses while interacting with the shell. Shell will be receiving commands from the user, issue requests of the right form and send them to the scheduler. Receive replies (success/fail) of the outcome of their executions and informs the user.
Commands of the shell:
- 'p' : prints a list with the running proccesses. Id,PID,Name are shown.
- 'k' : Gets the ID of a proccess (not the PID) and asks from the scheduler to terminate that proccess.
- 'e' : Gets the Name of a running proccess and asks from the scheduler to create a proccess with that name.
- 'q' : Shell terminates its operation.
- Implement priorities in the scheduler.
Extending the previous code we need also to support priorities in the running proccesses queue. There must be two priorities, High and Low. If there are any High priority proccesses in the queue, only those are been executed using round-robin. If there are olny Low priority proccesses in the queue, they are been executed using round-robin. In order to change the priority of any proccess the following command must be given:
- Make a low priority proccess high priority:
'h' id_of_the_proccess
- Make a high priority proccess low priority:
'l' id_of_the_proccess
- Make a low priority proccess high priority:
- Creating a round-robin scheduler. The scheduler is a parent proccess in the user space, distributing computational time in child processes. In order to control the processes, the scheduler will use the SIGSTOP and SIGCONT signals to stop and activate each process, respectively. Every proccess is being executed for a period of time equal to tq. If the proccess is terminated before the time equal to tq, the scheduler removes the proccess from the queue and activates the next one. If the time quantum is been reached and the proccess won't finish, the proccess terminates, its been placed to the end of the queue and the next proccess is been activated. The operation of the scheduler is required to be asynchronous based on signals. The scheduler will be using the SIGALRM (when the time quantum is reached the scheduler stops the current proccess) and SIGCHLD (pause or terminate the proccess) signals. Every proccess has its own id. The scheduler shows relevant messages at activation/pause/termination of a proccess. When all the proccesses are finished, the scheduler also terminates.
Execution of the scheduler: