Utime and stime stat11/10/2022 ![]() ![]() * Get file handle from file descriptor table of process 0 */ In fact, there are many other situations that are not considered here.*/ } while ( ( (utime + stime) / HZ ) = 3 are associated with files. Void cpuio_bound(int last, int cpu_time, int io_time) * If last > CPU_ time + io_ Time, the CPU and I/O are occupied repeatedly * io_time: Time consumed by one I/O, > = 0 is required * cpu_time: The time that the CPU is occupied continuously at one time, > = 0 is required Stime = current_time.tms_stime - start_time.tms_stime Utime = current_time.tms_utime - start_time.tms_utime * Large CPU users that only run in user state, like "for( ) ". * In fact, only t.tms_utime is the real CPU time. For example, after the process is created, it will become ready state When the process is scheduled, it will switch to the running state If a file read-write operation is started during operation, the operating system will switch the process to the blocking state (waiting state) to give up the CPU When the file is read and written, the operating system will switch it to thread state and wait for the process scheduling algorithm to schedule the execution of the process process.c interpretation void cpuio_bound(int last, int cpu_time, int io_time) The running track of the process in its life cycle is actually represented by multiple switching of the process state. The whole process from the creation of a process (call fork() under Linux) to the end is the life cycle of the process. Tracking and statistics of process running track ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |