From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Garzik Subject: Re: [Patch 1/1] tabled: Add replication daemon Date: Thu, 03 Dec 2009 00:42:47 -0500 Message-ID: <4B174FD7.5090603@garzik.org> References: <20091126193923.088ff34c@redhat.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=qEvpmv7fRiNfUnFHGM2EOWSd/cjr5gBGbM3CSW3X86s=; b=dunrEPDHcX7Lpx4cnPFmUu91v7zwbk0seO2iIJWcXVevB+dVgmptNRRGdLdQ2Q8Cgg SU0mQRLi+kpl4/uQbwSHMIkyujJbFxIRMHVDOoxAPl3Kh6oeBTECVKMaBIx+1FDDFQz4 /Oc3CX5AimpkOfoH0N/8biMFklNLp7V/brM8I= In-Reply-To: <20091126193923.088ff34c@redhat.com> Sender: hail-devel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Pete Zaitcev Cc: Project Hail List On 11/26/2009 09:39 PM, Pete Zaitcev wrote: > This patch adds what amounts to a background process that maintains > redundancy for object data. It is far from the complete solution. > For one thing, it does not verify checksums. But it's a start. > > There's no way to turn this off, by intention. The whole thing must > work very reliably, not steal too much from benchmarks (but if it > does, it's only honest to take the hit). It is indispensible. > However, there's a plan to add useful monitoring of jobs and other > state, such as available nodes. > > This implementation uses a separate thread. > > Signed-off-by: Pete Zaitcev The only thing I am unclear on / worried about is the event_base stuff for libevent. It seems to me you should a) leave current main-thread libevent code unchanged b) call event_base_new() for the new thread, passing that newly-created event_base to replica thread events using event_base_set(). event_reinit() seems more appropriate for forks than threads. tabled's needs are simple -- you simply need to create an additional event_base for the new thread. Other comments (which may be irrelevant given the above): > + /* Statics are a silly way to pass arguments to threads, but oh well. */ > + evbase = ev_base; > + > + scan_thread = g_thread_create(rep_thread_func, NULL, FALSE, &error); The second argument to g_thread_create() is a user-provided data pointer, passed directly to the newly created thread. No need for a static, AFAICS. Jeff