Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 29 09:45:10 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9TGjAnB021085 for ; Wed, 29 Oct 2008 09:45:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9TGuUJc018343 for ; Wed, 29 Oct 2008 09:56:30 -0700 Message-Id: <200810291656.m9TGuUJc018343@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CPU Hog Date: Wed, 29 Oct 2008 09:56:30 -0700 From: Bill Cheng Someone wrote: > I noticed that my process hogs the CPU sometimes. > And that is because if the "timer thread" that i have. > I am using a 1 second select timeout mechanism. What could be a problem > with this timer? Have you demonstrate to yourself that it's waking up only once per second? Run your code under the debugger and press and step through your code and find out why it's not sleeping! -- Bill Cheng // bill.cheng@usc.edu