completes the processes md and adds the exercises
This commit is contained in:
parent
e227b234c0
commit
d2c53af403
|
@ -376,11 +376,27 @@ Why do you think this is?
|
||||||
|
|
||||||
### Renice
|
### Renice
|
||||||
|
|
||||||
|
Nice values are that practical if we need to set them before we start a process no?
|
||||||
|
That's where the `renice` program comes into play.
|
||||||
|
It allows us to change the nice value of a running process with a very simple syntax.
|
||||||
|
I would advise you to use `sudo` when changing the nice values because otherwise you'll constantly run into either `operation not permitted` or `permission denied` errors.
|
||||||
|
|
||||||
|
```
|
||||||
|
➜ ~ git:(master) ✗ ping 8.8.8.8 > /dev/null &
|
||||||
|
[1] 16877
|
||||||
|
➜ ~ git:(master) ✗ ps o nice,pid,args -p 16877
|
||||||
|
NI PID COMMAND
|
||||||
|
5 16877 ping 8.8.8.8
|
||||||
|
➜ ~ git:(master) ✗ sudo renice -n 20 -p 16877
|
||||||
|
16877 (process ID) old priority 5, new priority 19
|
||||||
|
➜ ~ git:(master) ✗
|
||||||
|
```
|
||||||
|
|
||||||
## Exercises
|
## Exercises
|
||||||
|
|
||||||
Download the following files:
|
To help you understand what happens to running and stopped processes I made a few python scripts you can download below.
|
||||||
|
Run them either with `python3 $SCRIPT_NAME` or `./$SCRIPT_NAME`
|
||||||
|
|
||||||
* f
|
* [simple timer](./assets/processes_ex_01.py)
|
||||||
* f
|
* [timer with random keyboard prompt](./assets/processes_ex_02.py)
|
||||||
|
* [custom callback function for SIGALRM](./assets/processes_ex_03.py)
|
||||||
|
|
Loading…
Reference in New Issue