Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Sep 6 19:15:15 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 m872FEnx028381 for ; Sat, 6 Sep 2008 19:15:14 -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 m872Dq9a030459 for ; Sat, 6 Sep 2008 19:13:52 -0700 Message-Id: <200809070213.m872Dq9a030459@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: 551 warmup-1 auto-shutdown Date: Sat, 06 Sep 2008 19:13:52 -0700 From: Bill Cheng Someone wrote: > For the auto shutdown, when the timer expires we need to wait for the child > process to complete right (before shutting down) ? No. You need to wait for the child process to terminate and you should ask the child process to terminate as soon as possible. Your main server process should not quit before all the child processes have terminated. > So we set a flag and when all the child processes finish, we exit the server > thread. The child process is a separate process. So, setting a flag in the main server process would not work. You should send a signal to the child process using kill(). > If we press a ^C do we need to do the same thing ? should be handled the same way as SIGALRM. -- Bill Cheng // bill.cheng@usc.edu