Thread: system idle process

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    system idle process

    Hello everyone,


    In your experience, what is system idle process doing? In my experience, this means system is (CPU is waiting for) doing some I/O,

    1. like hard page fault;
    2. waiting for information from network.

    Are there any other cases which will cause system idle process happen and consume a non-neglitible percentage of CPU?


    thanks in advance,
    George

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    The primary reason IDLE is running is when all programs are sleeping and the user is not giving input. In other words, most of the time. While I sit for a moment and think about what to write, the idle process is taking over, except for the few cycles it takes the browser to draw the blinking caret.

    Well, except that I run Linux, of course.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    1,579
    Thanks CornedBee,


    You mean when system is not doing anything, it is idle, right?

    Sorry that I may not make myself understood, I mean what other case (beyond not doing anything) will cause system idle process happen. For example, will waiting for I/O cause idle?

    I am monitoring the performance of my C++ application. I see somethings there is a system idle process while my application is running and the percentage is not low (10%-20% sometimes). I want to know what reasons may cause the system into idle status -- this is the key point of my question (not what is, but what cause).

    If CPU is in idle status because of waiting for some resources, I think I have found the bottleneck of performance.

    Any ideas?

    Quote Originally Posted by CornedBee View Post
    The primary reason IDLE is running is when all programs are sleeping and the user is not giving input. In other words, most of the time. While I sit for a moment and think about what to write, the idle process is taking over, except for the few cycles it takes the browser to draw the blinking caret.

    Well, except that I run Linux, of course.

    regards,
    George

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    If your system is in idle when you are running a CPU-intensive process, then you are most likely seeing the effects of swapping and waiting for I/O, yes. In turn, that means that you are using MORE memory than you have available in the system.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    IDLE runs when nothing else is using the CPU. So yes, if all apps are waiting for I/O, IDLE will run.

    If you have a dual-core system and your application is strictly single-threaded, you may also find IDLE taking up up to 50% of CPU time. That's because the other core always idles.

    Moving this thread. George, that's two threads in a row you've created in C++ that have absolutely nothing to do with C++. You need to think about where you place your threads. We mods aren't your maids, that we clean up your mess.
    Last edited by CornedBee; 01-15-2008 at 03:18 AM.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  6. #6
    Registered User
    Join Date
    May 2006
    Posts
    1,579
    Thank Mats,


    "the effects of swapping" you mean page swap out? Page Stealing?

    Quote Originally Posted by matsp View Post
    If your system is in idle when you are running a CPU-intensive process, then you are most likely seeing the effects of swapping and waiting for I/O, yes. In turn, that means that you are using MORE memory than you have available in the system.

    --
    Mats

    regards,
    George

  7. #7
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    "The effect of swapping" as in reading pages in from disk and/or writing pages to disk to allow for "more memory used than there is available in the system".

    Of course, it could be any other form of I/O wait as well - without seeing your code, or knowing how much memory you use, etc, it would be almost impossible to actually know for sure.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  8. #8
    Registered User
    Join Date
    May 2006
    Posts
    1,579
    Thanks Mats,


    My question is answered.

    Quote Originally Posted by matsp View Post
    "The effect of swapping" as in reading pages in from disk and/or writing pages to disk to allow for "more memory used than there is available in the system".

    Of course, it could be any other form of I/O wait as well - without seeing your code, or knowing how much memory you use, etc, it would be almost impossible to actually know for sure.

    --
    Mats

    regards,
    George

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem With My Box
    By HaVoX in forum Tech Board
    Replies: 9
    Last Post: 10-15-2005, 07:38 AM
  2. Process Resources and System Limits Problem
    By yair in forum C Programming
    Replies: 2
    Last Post: 09-07-2005, 02:24 AM
  3. Process sending file descriptors to another process
    By Yasir_Malik in forum C Programming
    Replies: 4
    Last Post: 04-07-2005, 07:36 PM
  4. process ring
    By gregulator in forum C++ Programming
    Replies: 0
    Last Post: 02-28-2005, 08:21 PM
  5. System Idle Process
    By moonwalker in forum Tech Board
    Replies: 10
    Last Post: 08-09-2003, 08:17 PM