From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Garzik Subject: Re: [Patch] tabled: replace event_loopbreak with pipe Date: Thu, 04 Feb 2010 00:19:36 -0500 Message-ID: <4B6A58E8.7070904@garzik.org> References: <20100203200207.6235b8d9@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=V7D4voTijjLYc3bGeU/3OPl7xgODhfkYKpqoRCear0E=; b=VPdvk0Rg4oUygxFTNo+WmrxUdtpUemu+xeKXZwoA9pVk3ElqC51rrsFNpJHQf+1gK6 ZXNHuUF1i3J6tCveuS4QDdAO3cDnwVgsGoiWlUNEZDiDZuB8OWgBv8pzJT/4tPUjZHL3 qK2WO9PKvzj/BDwSDeN1ewfYPXFohuWTbKqzM= In-Reply-To: <20100203200207.6235b8d9@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 02/03/2010 10:02 PM, Pete Zaitcev wrote: > As it turned out, event_loopbreak() does not awaken the thread that > exectutes event_dispatch(), but our code expected that it would. > One easily noticeable effect was that there was a noticeable delay > between the state transition to DB master and listening on sockets. > I knew the mysterious delay existed for a while, but never got around > to investigate. For ncld API, I moved the processing of CLD packets > to its own thread and suddenly everything else froze. Apparently the > existing code only works because of extra packets of CLD protocol. > > For a fix, dispose of event_loopbreak and use a loopback pipe. > Also gone is state_tdb_new. That thing was just disgusting. > > Notice that we still have one event_loopbreak remaining, because it > works correctly thanks to UNIX signal awakening the polling thread. > > Signed-Off-By: Pete Zaitcev applied, with a few cosmetic changes (speling correction, use of 'switch')