https://github.com/maxam2017/introduction-to-operating-systems
NCTU / 作業系統概論 / 張立平
https://github.com/maxam2017/introduction-to-operating-systems
Last synced: over 1 year ago
JSON representation
NCTU / 作業系統概論 / 張立平
- Host: GitHub
- URL: https://github.com/maxam2017/introduction-to-operating-systems
- Owner: maxam2017
- Created: 2018-03-28T08:48:04.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-14T02:28:45.000Z (about 8 years ago)
- Last Synced: 2025-02-15T20:41:41.644Z (over 1 year ago)
- Language: C
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Introduction-to-Operating-Systems
NCTU / 作業系統概論 / 張立平
### hw1
* prevent zombie process when excuting in background
* fork twice and kill the first one
* the ppid of grandchild process is 1 (init) [adopted]
### hw2
* `ipcs -M` show shared memory size [shmmax]
* segment fault ==> enlarge shared memory
* edit `/etc/sysctl.conf`
* setting `shmmax` twice larger than before
```
kern.sysv.shmmax=16777216
kern.sysv.shmmin=1
kern.sysv.shmmni=128
kern.sysv.shmseg=32
kern.sysv.shmall=4096
```
* `ipcs -m` show the info of processes which take up shared memory
* `ipcrm -m ` clear the shared memory taken up by this process
### hw3
* compile
* -pthead
* -g : for gdb
* not fit requirement
* using T0 to fulfill pthread_join
* this code using main function to recycle last 8 threads
### hw4
* using a semaphore[add] to restrict the dimension of thread pool
* this semaphore post once when the dimension of thread pool increment
* capacity = semaphore value
* using a semaphore[work] to wait sorting
* post this semaphore when a task push into job list
* using a semaphore[done] to wait last 8 threads(bubble sort)
* wait at main function (may not fulfill requirement)
### hw5
* page replacement
> use to implement hash [reference string to frame]
* FIFO
* LRU (least recently used)
* using double linked list to record LRU memory
### hw6
* for parsing argument more easily.
* use to open directory recursively.
* get the metadata of file/directory.