Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 17 14:35:19 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 m8HLZJiH015536 for ; Wed, 17 Sep 2008 14:35:19 -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 m8HLaY81031344 for ; Wed, 17 Sep 2008 14:36:34 -0700 Message-Id: <200809172136.m8HLaY81031344@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: proj 2 ques Date: Wed, 17 Sep 2008 14:36:34 -0700 From: Bill Cheng Someone wrote: > Regarding the size of the queue, isnt the default size of the queue=5, > so we can use that as a limit right? 5 is the default size. So, if you don't specify -size in your commandline, you should use 5. If someone uses "-size 2147483647", your code should not allocate an array of 2147483648 elements! I guess the real maximum for size should be 2^32-1=4294967295. -- Bill Cheng // bill.cheng@usc.edu On Wed, Sep 17, 2008 at 10:13 AM, Bill Cheng wrote: > Someone wrote: > > > I have follwing questions > > 1) I have used 3 threads in prog - arrival and 2 server.Can any > > one of these threads handle contrl C and set termination flag > > or all threads will have to handle it. > > I think you should have only one thread handling > and that thread should wake all other threads up. So, > essentially, all threads are woken up by . > > > 2) What is max size for customers and queue? > > No max size. So, you should use a linked list of a > dynamic array to implement the queue. > > > 3) Can we assume that file is in proper format if trace file is > > specified? > > That's never a good idea. You can assume that it's in the > proper format. As soon as you detect something unexpected, > you assume that it's an error and quit (and print out why > you quit). > -- > Bill Cheng // bill.cheng@usc.edu