Category Archives: Notes of APUE2

Reading Notes of APUE2

Notes of AUPE, chp 1

1. File IO: buffered & unbuffered (From Section 1.5) C标准库(stdio.h)提供的文件读写函数,如fread和fwrite是有缓存的。缓存写意味着内容不一定会立即写到磁盘上。其好处在于用户不需要考虑读写缓存,接口已经做了缓存; 系统(unistd.h)所提供的读写接口,如read和write是没有缓存的。这样写的内容会立即反映到磁盘上,适用于不能丢数据的场景。但是接口读写的buffer大小对效率会有影响 2. Process Control (From Section 1.6) Process: There are three primary functions for process control: fork, exec, and waitpid. Control-D, or ^D, is the default end-of-file character. Threads: All the threads … Continue reading

Posted in Notes of APUE2 | Leave a comment