Return-Path: X-Original-To: apmail-incubator-accumulo-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-accumulo-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 AB9729306 for ; Wed, 2 Nov 2011 02:54:04 +0000 (UTC) Received: (qmail 38760 invoked by uid 500); 2 Nov 2011 02:54:04 -0000 Delivered-To: apmail-incubator-accumulo-dev-archive@incubator.apache.org Received: (qmail 38742 invoked by uid 500); 2 Nov 2011 02:54:04 -0000 Mailing-List: contact accumulo-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: accumulo-dev@incubator.apache.org Delivered-To: mailing list accumulo-dev@incubator.apache.org Received: (qmail 38733 invoked by uid 99); 2 Nov 2011 02:54:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Nov 2011 02:54:03 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.161.47] (HELO mail-fx0-f47.google.com) (209.85.161.47) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Nov 2011 02:53:57 +0000 Received: by faas16 with SMTP id s16so7958111faa.6 for ; Tue, 01 Nov 2011 19:53:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.76.197 with SMTP id d5mr5160726fak.13.1320202416532; Tue, 01 Nov 2011 19:53:36 -0700 (PDT) Received: by 10.223.83.3 with HTTP; Tue, 1 Nov 2011 19:53:36 -0700 (PDT) In-Reply-To: <4EB06EB6.1090004@digitalreasoning.com> References: <4EB04FE3.5020005@digitalreasoning.com> <4EB06EB6.1090004@digitalreasoning.com> Date: Tue, 1 Nov 2011 22:53:36 -0400 Message-ID: Subject: Re: ScannerIterator thread use From: Keith Turner To: accumulo-dev@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Nov 1, 2011 at 6:12 PM, Keith Massey wrote: > > I'm not incredibly familiar with this code, but it could be a static thread > pool right? And just let all ScannerIterators share some configurable thread > pool? The thread would just be returned to the pool when the Reader > completed. > When I think of thread pools, I always think of setting an upper bound on the number of threads. It occurred to me that we could use a static thread pool if it were unbounded. This would replicate the current behavior and allow for thread reuse. So make the core size small (0,1 or 2), the max size MAX_INT, the timeout small (few seconds), and use a SynchronousQueue. Everything added to the pool should create a new thread if one is not available. Also make the threads daemon threads so they do not keep the process alive.