Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Sep 19 20:40:54 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.3 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 m8K3es1i018064 for ; Fri, 19 Sep 2008 20:40:54 -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 m8K3gglT022122 for ; Fri, 19 Sep 2008 20:42:42 -0700 Message-Id: <200809200342.m8K3gglT022122@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CSC551 Date: Fri, 19 Sep 2008 20:42:42 -0700 From: Bill Cheng Someone wrote: > I have tried using select() and pthread_cond_timedwait() to > wait but my process still consumes a lot of CPU cycles. I always > broadcast the condition mutex before calling any of these > functions.Every thread goes into a while loop which loops until > all arrivals have taken place and are serviced except if > interrupted with a cntrl+C. Is there anything else I can do to > reduce the CPU usage? What's the timeout for your select() and pthread_cond_timewait()? -- Bill Cheng // bill.cheng@usc.edu