Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 23 20:36:18 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 m9O3aIta029628 for ; Thu, 23 Oct 2008 20:36:18 -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 m9O3kLRa007826 for ; Thu, 23 Oct 2008 20:46:21 -0700 Message-Id: <200810240346.m9O3kLRa007826@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Soft restart Date: Thu, 23 Oct 2008 20:46:21 -0700 From: Bill Cheng Someone wrote: > We have got the responses from the beacons for the non-beacon nodes and we > store them in an init_neighbor_list file. > > The next step is that the non-beacon nodes do a 'soft restart' , come up, > read the ini_neighbor_list file and send hello messages to the beacon nodes. > Is this correct ? Yes. > Also, what exactly does a node do in a soft restart ? The idea is that you should write your code such that when you do a soft restart, it should be *exactly* like the case where you do a shutdown and then start your node again. So, I would so something like the following in main(): int main(...) { shutdown = FALSE; while (!shutdown) { Init(); /* initialize everything except for the shutdown variable */ DoEverything(); CleanUp(); /* clean up everything */ } } The only thing that set shutdown to TRUE if when the user types "shutdown" or when auto-shutdown happens. You can also have additional conditions where you set shutdown to be TRUE. Otherwise, you node should loop over and over again. -- Bill Cheng // bill.cheng@usc.edu