Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id DB1BF1337BCE for ; Tue, 29 Mar 2011 07:33:41 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 10808-01 for ; Tue, 29 Mar 2011 10:33:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f46.google.com (mail-fx0-f46.google.com [209.85.161.46]) by mail.postgresql.org (Postfix) with ESMTP id 97D18133655C for ; Tue, 29 Mar 2011 07:33:23 -0300 (ADT) Received: by fxm17 with SMTP id 17so75042fxm.19 for ; Tue, 29 Mar 2011 03:33:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=aE5GEisckihkcKSFwtpcI1d3FbTeXMMKhknmp+I7x/w=; b=KARrRH+mvweF2WPP9EAoIWvCiFobrKxbkSn2E8W0VF5QKMhGGmuJQmZPdrxNOOBT5c UWvGO9bydHa500m8LKebw/qynp+7WzdXW8n75x8tKpaAM3/yaLWU2Q2oyMfx0FyzZ4xV vbd+toiCIbdRHmaLEECgUWHvL5kByX5mjlCjs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=JtqKzkfXUDm4OqCVtZjhTiwpQXHYavGF9Hbs27P3tT59kMtOM/Ab3I6ZqZI29DTkSg DB1dmuk0IsWoid0YXDnGsrh9mQ3NWqy8PvHRj80c902uoAx2Dcsanu74Vd1vc58G81mE c4lDhKHxFMIw19t3OQoSE88C9q73tdn5aQKYg= Received: by 10.223.9.137 with SMTP id l9mr5611201fal.25.1301394802790; Tue, 29 Mar 2011 03:33:22 -0700 (PDT) Received: from [10.1.1.57] (skuns.zoral.com.ua [91.193.166.194]) by mx.google.com with ESMTPS id f15sm1891826fax.10.2011.03.29.03.33.20 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 29 Mar 2011 03:33:21 -0700 (PDT) Message-ID: <4D91B571.7080208@gmail.com> Date: Tue, 29 Mar 2011 13:33:21 +0300 From: Vitalii Tymchyshyn User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8 MIME-Version: 1.0 To: Craig Ringer CC: Dave Cramer , List Subject: Re: JDBC gripe list References: <4D914191.8050103@postnewspapers.com.au> In-Reply-To: <4D914191.8050103@postnewspapers.com.au> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.346 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=1.553, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201103/105 X-Sequence-Number: 21660 29.03.11 05:18, Craig Ringer написав(ла): > On 03/27/2011 11:14 PM, Dave Cramer wrote: > > Timers can use one shared thread for all timers, either a generic > timer thread provided by the JVM or (IMO better in this case) one > dedicated to that timer pool. I think it'd be an ideal way to do it > personally - the JDBC driver has several issues that'd be solvable by > adding a single thread to use for various timers, etc. > > If there are concerns about the driver spawning a thread, it wouldn't > be too tricky to make timer-requiring features conditional on a > connection param, so if no connections that were going to use > timer-based features were made, no thread would be spawned. Personally > I don't think a single shared thread is worth worrying about, though. > Have you *seen* the thread lists in a modern Java app? Threads are > extremely low cost when idle, and are already heavily used throughout > Java and the JVM. BTW: May be a wrapper over Socket can be created that will allow "hand-made" timers with socket channel selectors? In this case no new thread will be required. Best regards, Vitalii Tymchyshyn