Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 18 22:11:48 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 m8J5Bmmv003063 for ; Thu, 18 Sep 2008 22:11:48 -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 m8J5DMZu030943 for ; Thu, 18 Sep 2008 22:13:22 -0700 Message-Id: <200809190513.m8J5DMZu030943@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Prj 2 Date: Thu, 18 Sep 2008 22:13:22 -0700 From: Bill Cheng Someone wrote: > Do InitRand and GetInterval need to be called on the same thread? I always > get 0 from (double) dran48() You should call InitRand() in the initialization routine of your main thread, before any child thread is created. You should use a mutex to make sure that only one thread is executing in GetInterval(). I'm not sure why drand48() is returning zeroes. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: Bill Cheng [mailto:william@bourbon.usc.edu] Sent: Thursday, September 18, 2008 5:10 PM To: cs551@merlot.usc.edu Subject: Re: Prj 2 Someone wrote: > Can you have multiple conditional waits on the same mutex lock? Let's be precise... You can have multiple threads waiting on the same condition variable. -- Bill Cheng // bill.cheng@usc.edu