http://chiakie.pixnet.net/blog/post/13281873
http://www.lslnet.com/linux/f/docs1/i65/big5426002.htm
2012年5月13日 星期日
2012年5月7日 星期一
CPU affinity
http://en.wikipedia.org/wiki/Affinity_mask
http://en.wikipedia.org/wiki/Processor_affinity
2012年4月5日 星期四
解決 /usr/bin/ld: cannot find -lxxx 問題
http://i-pogo.blogspot.com/2010/01/usrbinld-cannot-find-lxxx.html
2012年4月1日 星期日
time 的 說明
One of these things is not like the other. Real refers to actual elapsed time; User and Sys refer to CPU time used only by the process.
Real is wall clock time - time from start to finish of the call. This is all elapsed time including time slices used by other processes and time the process spends blocked (for example if it is waiting for I/O to complete).
User is the amount of CPU time spent in user-mode code (outside the kernel) within the process. This is only actual CPU time used in executing the process. Other processes and time the process spends blocked do not count towards this figure.
Sys is the amount of CPU time spent in the kernel within the process. This means executing CPU time spent in system calls within the kernel, as opposed to library code, which is still running in user-space. Like 'user', this is only CPU time used by the process. See below for a brief description of kernel mode (also known as 'supervisor' mode) and the system call mechanism.
User+Sys will tell you how much actual CPU time your process used. Note that this is across all CPUs, so if the process has multiple threads it could potentially exceed the wall clock time reported by Real. Note that in the output these figures include the User and Sys time of all child processes as well, although the underlying system calls return the statistics for the process and its children separately.
Real 從 下 command 到 看到結果所需要的全部時間
user CPU 在處理 這個 code 所耗的時間
sys cpu 在處理 kernal 的調度所花的時間 例如call library 或是 執行其他的process
在單核心中 如果 Real = User + Sys
但在多核心 且 使用 thread 的情況下
User +Sys 可能 > Real
因為 user 的計算是 每一顆 的時間都 加起來 因此 有兩顆 同時執行五秒 值計算為 10秒
reference 網頁
http://stackoverflow.com/questions/556405/what-do-real-user-and-sys-mean-in-the-output-of-time1
Real is wall clock time - time from start to finish of the call. This is all elapsed time including time slices used by other processes and time the process spends blocked (for example if it is waiting for I/O to complete).
User is the amount of CPU time spent in user-mode code (outside the kernel) within the process. This is only actual CPU time used in executing the process. Other processes and time the process spends blocked do not count towards this figure.
Sys is the amount of CPU time spent in the kernel within the process. This means executing CPU time spent in system calls within the kernel, as opposed to library code, which is still running in user-space. Like 'user', this is only CPU time used by the process. See below for a brief description of kernel mode (also known as 'supervisor' mode) and the system call mechanism.
User+Sys will tell you how much actual CPU time your process used. Note that this is across all CPUs, so if the process has multiple threads it could potentially exceed the wall clock time reported by Real. Note that in the output these figures include the User and Sys time of all child processes as well, although the underlying system calls return the statistics for the process and its children separately.
Real 從 下 command 到 看到結果所需要的全部時間
user CPU 在處理 這個 code 所耗的時間
sys cpu 在處理 kernal 的調度所花的時間 例如call library 或是 執行其他的process
在單核心中 如果 Real = User + Sys
但在多核心 且 使用 thread 的情況下
User +Sys 可能 > Real
因為 user 的計算是 每一顆 的時間都 加起來 因此 有兩顆 同時執行五秒 值計算為 10秒
reference 網頁
http://stackoverflow.com/questions/556405/what-do-real-user-and-sys-mean-in-the-output-of-time1
2012年3月25日 星期日
time 指令
time 指令 !
會顯示 執行的 時間 列表 !!!
ex
time /.a.out
會顯示出
4. real 0m0.136s
5. user 0m0.010s
6. sys 0m0.070s
類似這樣的結果
會顯示 執行的 時間 列表 !!!
ex
time /.a.out
會顯示出
4. real 0m0.136s
5. user 0m0.010s
6. sys 0m0.070s
類似這樣的結果
2012年3月20日 星期二
pid_t
http://www.delorie.com/gnu/docs/glibc/libc_566.html
26.3 Process Identification
The pid_t data type represents process IDs. You can get the process ID of a process by calling getpid. The function getppid returns the process ID of the parent of the current process (this is also known as the parent process ID). Your program should include the header files `unistd.h' and `sys/types.h' to use these functions.
Data Type: pid_t
The pid_t data type is a signed integer type which is capable of representing a process ID. In the GNU library, this is an int.
Function: pid_t getpid (void)
The getpid function returns the process ID of the current process.
Function: pid_t getppid (void)
The getppid function returns the process ID of the parent of the current process.
26.3 Process Identification
The pid_t data type represents process IDs. You can get the process ID of a process by calling getpid. The function getppid returns the process ID of the parent of the current process (this is also known as the parent process ID). Your program should include the header files `unistd.h' and `sys/types.h' to use these functions.
Data Type: pid_t
The pid_t data type is a signed integer type which is capable of representing a process ID. In the GNU library, this is an int.
Function: pid_t getpid (void)
The getpid function returns the process ID of the current process.
Function: pid_t getppid (void)
The getppid function returns the process ID of the parent of the current process.
2012年2月8日 星期三
訂閱:
文章 (Atom)