From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pete Zaitcev Subject: Re: [PATCH v3] CLD replication (WIP) Date: Tue, 11 Aug 2009 17:56:39 -0600 Message-ID: <20090811175639.43a1cec4@redhat.com> References: <20090731104031.GA21249@havoc.gtf.org> <20090810182435.GA23238@havoc.gtf.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20090810182435.GA23238@havoc.gtf.org> Sender: hail-devel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Jeff Garzik Cc: hail-devel@vger.kernel.org On Mon, 10 Aug 2009 14:24:35 -0400, Jeff Garzik wrote: > + /* > + * This callback runs on the context of the replication > + * manager thread, and calling any of our functions thus > + * turns our program into a multi-threaded one. Instead > + * we do a loopbreak and postpone the processing. > + */ > + /* wake up main loop */ > + write(cld_srv.rep_pipe[1], &c, 1); Might want to change the comment, you don't literally do a loopbreak if libevent is not present. Change it to "signal the main thread" or something like that. BTW, you don't need state_cldb_new anymore, write the desired state or signal type into your pipe and voila. I always thought that the two-stage state change was excessively ugly, but without a pipe I didn't see an alternative. > cldlog(LOG_INFO, "initialized: dbg %u", > debugging); > + cldlog(LOG_INFO, "replication: %s:%u", > + cld_srv.myhost, > + cld_srv.rep_port); Meh, it can easily fit on one line. -- Pete