10 2012 档案

摘要:fractions of a secondmetric name0,000 000 000 000 000 000 000 001yoctosecond [ ys ]0,000 000 000 000 000 000 001zeptosecond [ zs ]0,000 000 000 000 000 001attosecond [ as ]0,000 000 000 000 001femtose... 阅读全文
posted @ 2012-10-30 11:33 ohscar 阅读(146) 评论(0) 推荐(0) 编辑
摘要:以下4个原则摘自《Unix™ Systems Programming: Communication, Concurrency, and Threads》1,使用库函数和系统调用时,查一下手册,确认是否会被sginal打断。如果会有EINTR,那么需要反复调用。2,自己编写signal处理函数时,确认使用的库函数是signal-safe的!即,可重入的。3,自己编写signal处理函数时,小心处理全局数据和静态数据!类似多线程的资源竞争。4,自己编写signal处理函数时,先保存errno,处理完毕后,恢复errno 阅读全文
posted @ 2012-10-29 20:03 ohscar 阅读(338) 评论(0) 推荐(0) 编辑
摘要:摘自《Unix™ Systems Programming: Communication, Concurrency, and Threads》 Make use of return values to communicate information and to make error trapping easy for the calling program.用好返回值,使得错误处理简单一些。 Do... 阅读全文
posted @ 2012-10-16 13:23 ohscar 阅读(141) 评论(0) 推荐(0) 编辑