Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Sep 15 20:53:38 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 m8G3rcSJ018519 for ; Mon, 15 Sep 2008 20:53:38 -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 m8G3sR8I020238 for ; Mon, 15 Sep 2008 20:54:27 -0700 Message-Id: <200809160354.m8G3sR8I020238@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: 551 warmp2 Date: Mon, 15 Sep 2008 20:54:27 -0700 From: Bill Cheng Someone wrote: > The specification says the following : > > "You need to calculate the time correctly for the select() mentioned above. > For example, with Poisson arrivals, let's say that the arrival process needs > to wait 634 milliseconds between the arrivals of customers c1 and c2. > Assuming that it took 45 milliseconds to do bookkeeping and to enqueue the > customer to the queueing system, you should sleep for 589 milliseconds (and > not sleep for 634 milliseconds). Please note the bookkeeping time for > servers *should be* zero!" > > The question is how do we calculate the book keeping time. Should it be a > deterministic quantity or random ???? It should be whatever you *measured*. So, it's probably different every time you calculate it. When your arrival thread wakes up, you need to read the system clock. Let's say that the clock value is X. Then your arrival thread does what it suppose to. When it's ready to sleep, it reads the system clock again and let's say that the value of the clock is Y. Y-X is referred to as the "bookkeeping time". -- Bill Cheng // bill.cheng@usc.edu