Re: open FIFO blocking with select - high CPU

From: Alex Fraser (me_at_privacy.net)
Date: 10/29/05


Date: Sat, 29 Oct 2005 17:58:20 +0100


<dhanks@gmail.com> wrote in message
news:1130563913.318686.37090@g14g2000cwa.googlegroups.com...
> I've open(2)ed a FIFO and I'm blocking. I use select(2) to detect if
> there is data to read(2).
>
> I tested my FIFO brain puzzle with:
>
> $ cat /dev/zero > /tmp/FIFO
>
> Which should really put it to work. My problem is that my program is
> using a lot of CPU after I ^C the cat /dev/zero and the program is
> doing nothing but sleeping (blocking) on the select(2). I've also
> placed a ticker above the select(2) to visually ensure that the program
> isn't in an infinite loop.
>
> Again, just to clarify: I understand the the program should use a lot
> of CPU while it is read(2)ing from my stress test with cat /dev/zero,
> but _after_ I have ^C the cat, so that the program is doing nothing at
> all and awaiting more things to read(2), it continually shows high CPU
> usage with ps aux - but the CPU grandually goes back down to normal.

CPU usage is always averaged over a period of time. You'll no doubt find a
similar gradual increase if you start your program first, wait a while (with
it blocked in open()), then execute the cat command above.

Alex



Relevant Pages

  • Re: Yet another SVCHOST.EXE posting (my workaround)
    ... SVCHOST.EXE is an important part of Windows. ... Process Explorer you can see which and that is why I asked about the Command ... about the Windows Automatic Update service -a common cause of excessive CPU ... First off I killed PID 1302 and noticed that CPU usage fell down ...
    (microsoft.public.windowsxp.general)
  • Re: 99-100% Explorer Processor Usage
    ... Looking at a third incident on a separate PC of 'explorer.exe' hitting ... and see if the CPU is bogged down without the client installed. ... CPU usage hits 99-100% even where the PC has the custom application ... The tool expressly indicates the 'parent'/root 'Windows Explorer' is ...
    (microsoft.public.windowsxp.general)
  • Re: Does a Repair Install Affect Performance?
    ... I suggest you try cCleaner. ... CPU shot up to 80%+ for about 12 seconds while it started. ... > IE, iTunes, Microsoft Antispyware and Process Explorer itself. ... >>>> Sometimes CPU usage spikes when lots of apps open, ...
    (microsoft.public.windowsxp.perform_maintain)
  • Terminal Server 2003 full CPU usage
    ... This almost regardles to the time the server is running. ... one process is maxing out at 80% to 99% CPU ... also RES Powerfuse has been installed. ... another process will take over full CPU usage. ...
    (microsoft.public.windows.terminal_services)
  • Re: Does a Repair Install Affect Performance?
    ... When the performance is poor check on CPU for unexplained activity. ... For further information about Process Explorer see here: ... >> Sometimes CPU usage spikes when lots of apps open, ... >>> One file suggests you have a Dell computer. ...
    (microsoft.public.windowsxp.perform_maintain)