Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 25 18:01:39 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 m8Q11d55020356 for ; Thu, 25 Sep 2008 18:01:39 -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 m8Q14qHq030604 for ; Thu, 25 Sep 2008 18:04:52 -0700 Message-Id: <200809260104.m8Q14qHq030604@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs551 prob with select() Date: Thu, 25 Sep 2008 18:04:52 -0700 From: Bill Cheng Someone wrote: > just a clarification. u had specified that we have to sleep for at most > 10,000 seconds in the mail, but the spec says > > "The return value of GetInterval() should be an integer having a unit of > milliseconds. To make things easier to manage, we limit the value of this > integer to be between 1 and 10,000." > > isnt that supposed to be 10,000 milliseconds? > > if so, usleep() should work rite? You are absolute correct! I guess I was confused. -- Bill Cheng // bill.cheng@usc.edu On Tue, Sep 23, 2008 at 11:02 PM, Bill Cheng wrote: > Someone wrote: > > > Is there any reason for select() not working or sleeping for the > specified > > amount of time. > > I'm not sure what you meant by "not working". To me, not > working means that if you try to sleep for X seconds, it > returns without sleeping. Is that what's going on? > > > I tried replacing it with usleep() and it works fine. > > If it works for you, then feel free to use it. I thought the > argument of usleep() is a 32-bit unsigned integer! So, the > maximum you can specify is to sleep for 4294967295 microseconds > and this is only 4,295 seconds. Our spec implies that you > need to be able to sleep for at most 10,000 seconds. > -- > Bill Cheng // bill.cheng@usc.edu