block and unblock process: assignment report2
I am sharing the second assignment from Shibata's team / 2017 in
https://drive.google.com/file/d/0ByqqM2mCIz0jdzVMMlp4THBUd3hGdFg0TFlCOXdVbHRKek9n/view?usp=sharing
In order to run:
~/Downloads/pcs3746-sistemas-operacionais/1$ docker run -ti --rm -v "$PWD/linux":/home/student/src/linux -v "$PWD/../2/initramfs":/home/student/src/initramfs tiagoshibata/pcs3746
They implemented stop_process(pid) and continue_process().
stop_process(pid): blocks the process pid and inserts in a list Blocked_list
continue_process(): make the first process of the Blocked_list ready to run.
In order to test, we have 3 processes: grand_parent, parent and child. The parent process get char from the keyboard and may block itself ("b") or the child ("a"). It will unblock using "d". The parent process prints "A" and the child consecutive numbers. Using the keyboard (ex: "a" followed by enter) you may block or unblock the parent and child. Pretty cool!
https://drive.google.com/file/d/0ByqqM2mCIz0jdzVMMlp4THBUd3hGdFg0TFlCOXdVbHRKek9n/view?usp=sharing
In order to run:
~/Downloads/pcs3746-sistemas-operacionais/1$ docker run -ti --rm -v "$PWD/linux":/home/student/src/linux -v "$PWD/../2/initramfs":/home/student/src/initramfs tiagoshibata/pcs3746
They implemented stop_process(pid) and continue_process().
stop_process(pid): blocks the process pid and inserts in a list Blocked_list
continue_process(): make the first process of the Blocked_list ready to run.
In order to test, we have 3 processes: grand_parent, parent and child. The parent process get char from the keyboard and may block itself ("b") or the child ("a"). It will unblock using "d". The parent process prints "A" and the child consecutive numbers. Using the keyboard (ex: "a" followed by enter) you may block or unblock the parent and child. Pretty cool!
Comentários
Postar um comentário