Return-Path: X-Original-To: apmail-incubator-kafka-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-kafka-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A907D75BD for ; Tue, 1 Nov 2011 18:35:10 +0000 (UTC) Received: (qmail 73867 invoked by uid 500); 1 Nov 2011 18:35:10 -0000 Delivered-To: apmail-incubator-kafka-dev-archive@incubator.apache.org Received: (qmail 73846 invoked by uid 500); 1 Nov 2011 18:35:10 -0000 Mailing-List: contact kafka-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: kafka-dev@incubator.apache.org Delivered-To: mailing list kafka-dev@incubator.apache.org Received: (qmail 73835 invoked by uid 99); 1 Nov 2011 18:35:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2011 18:35:10 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of e.vanoosten@grons.nl designates 83.163.41.27 as permitted sender) Received: from [83.163.41.27] (HELO mail.grons.nl) (83.163.41.27) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2011 18:35:04 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.grons.nl (Postfix) with ESMTP id 24D9F5A8226 for ; Tue, 1 Nov 2011 19:34:41 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at grons.nl Received: from mail.grons.nl ([127.0.0.1]) by localhost (atomgrons.private [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id t5qCTux5UTfa for ; Tue, 1 Nov 2011 19:34:37 +0100 (CET) Received: from macgrons.fritz.box (macgrons.fritz.box [192.168.178.24]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.grons.nl (Postfix) with ESMTPSA id 925015A8144 for ; Tue, 1 Nov 2011 19:34:37 +0100 (CET) Message-ID: <4EB03BC0.6060704@grons.nl> Date: Tue, 01 Nov 2011 19:34:40 +0100 From: Erik van Oosten User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: kafka-dev@incubator.apache.org Subject: Re: KAFKA-50 replication support and the Disruptor References: <4EADAD36.6080406@grons.nl> <4EAF0747.3090804@gmail.com> In-Reply-To: <4EAF0747.3090804@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit There are several wait strategies. You will want to use spin lock in production environments where you should have enough CPU cores anyway. Remember, the 'real' work runs in another always running thread that also uses a spin lock to wait for more work. In dev environment or hosts that need to do lots of other stuff, you definitely need another wait strategy. Erik. Op 31-10-11 21:38, Chris Burroughs wrote: > On 10/31/2011 04:23 AM, Erik van Oosten wrote: >> That is not the point (mostly). While you're waiting for a lock, you can't issue another IO request. Avoiding locking is worthwhile even if CPU is the bottleneck. The advantage is that you'll get lower latency and also important, less jitter. > /begin{Tangent} > > Doesn't the Disruptor use a spin lock though? I would expect that to > not play nice if sharing a core with CPU bound threads doing 'real' work. -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/