Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 28 11:23:37 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 m9SINbws007036 for ; Tue, 28 Oct 2008 11:23:37 -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 m9SIYg3c032281 for ; Tue, 28 Oct 2008 11:34:42 -0700 Message-Id: <200810281834.m9SIYg3c032281@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Auto Shut Down and Shut Down Date: Tue, 28 Oct 2008 11:34:42 -0700 From: Bill Cheng Someone wrote: > During the shut down phase and autoshutdown should we wait to > make sure that notify message to other nodes is sent ? > At present I am waiting arbitrary 1 sec to make sure that notify > is sent (I need to wait as I am using a queue for each socket .. > I can short circuit it but I am avoiding it) .. is that okay or > should I short circuit it and send it directly on that socket > (still we will have to wait atleast for the TCP buffer.) You should send NOTIFY when you are going to disconnect. You are also suppose to shutdown gracefully. Therefore, when it comes time to shutdown, you should set a global flag so that no thread will serve anything new. You can also delete all existing jobs from all queues and tell each sender to send their last NOTIFY message. Then all thread should self terminate. Finally, your main thread terminates. I don't see the need to sleep for 1 second. -- Bill Cheng // bill.cheng@usc.edu