Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 64734 invoked from network); 12 Oct 2007 11:20:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Oct 2007 11:20:28 -0000 Received: (qmail 89066 invoked by uid 500); 12 Oct 2007 11:20:15 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 89036 invoked by uid 500); 12 Oct 2007 11:20:15 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 89027 invoked by uid 99); 12 Oct 2007 11:20:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Oct 2007 04:20:15 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of aleksey.shipilev@gmail.com designates 209.85.198.188 as permitted sender) Received: from [209.85.198.188] (HELO rv-out-0910.google.com) (209.85.198.188) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Oct 2007 11:20:18 +0000 Received: by rv-out-0910.google.com with SMTP id k20so925869rvb for ; Fri, 12 Oct 2007 04:19:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=Iyq8s69NKl/0AY52AmSvUBiajD6X3/WZ9hNVJy+QfR0=; b=QIJZGkvq+4ZYQj5Ya0ml0a9HIWREqXX6S2lK7XRTICaryVea/i0yz3tZu03bpNgK1x5tY9dmBiY4iNnc/HngYRX51KrzEcbNRhWc8fbelB7DyuYmVGlP0MQ3UcKNapMxl20tXq4NuO+dHwJAx0UrkxTsprn8MVF5I+/IxHhFVZQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=bkBb6WhBNGy5R1vfbPj+/0C18xp695yZaT873nWIK4v5+xgKg3MpJmz+0mqwMteFbHvMY9B1xq4+6bt/DkcHmMxlG8/rgIIJQ9UTPjf5vZXH7D8OR5kaLaNwxeCJsdF+nQ52qkZSYhD33Sanke07JufvivmrHgE+xqb/v8SL1f4= Received: by 10.142.140.14 with SMTP id n14mr899086wfd.1192187996970; Fri, 12 Oct 2007 04:19:56 -0700 (PDT) Received: by 10.143.6.19 with HTTP; Fri, 12 Oct 2007 04:19:56 -0700 (PDT) Message-ID: <4bebff790710120419n70710a30hf3e0a1f475692d26@mail.gmail.com> Date: Fri, 12 Oct 2007 15:19:56 +0400 From: "Aleksey Shipilev" To: dev@harmony.apache.org Subject: Re: [classlib][nio] epoll()-based Selector In-Reply-To: <2c9597b90710110503h223eb1e1h600ff71e8d80fe41@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4bebff790710010849q3116964br7d85dc5a5b5f20a7@mail.gmail.com> <4bebff790710040356s77a3200el7e6ce03a80222c6b@mail.gmail.com> <5c8e69f0710080146u6a53e1b9hed1ccdab5781c466@mail.gmail.com> <4bebff790710080218t69777ac4u19046c1b7d17e009@mail.gmail.com> <4bebff790710080246qe981904md6015aa90950fb7a@mail.gmail.com> <470DD612.8030308@gmail.com> <2c9597b90710110503h223eb1e1h600ff71e8d80fe41@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Alexei, Thanks! The patch was applied OK. So now we have two main issues: 1. We need to detect the kernel at the build time and prevent breaking the compilation due to lack of epoll kernel API. 2. We need to detect the kernel at the run time and switch on EpollSelectorProviderImpl. For (1) I propose to include and then: #if (LINUX_KERNEL_CODE >= KERNEL_VERSION(2, 6, 0)) // do some epoll activity here #else printf("Error: epoll facility is not implemented, please rebuild on newer kernel\n"); #endif If it sounds right, I will go ahead and make the patch for it. Thanks, Aleksey. On 10/11/07, Alexei Zakharov wrote: > Hi all, > > FYI yesterday I've committed Aleksey's patch for HARMONY-4879. > However, I afraid in spite of the fact that new epoll-based provider > is disabled by default corresponding native sources simply cannot be > compiled if kernel's version is less than 2.5.44 because of unresolved > references to epoll_ctl. According to manual: " epoll(7) is a new API > introduced in Linux kernel 2.5.44. Its interface should be finalized > in Linux kernel 2.5.66." Thus, it looks like we should detect kernel > version during the build time via "uname --kernel-release" or > something like it. Did I miss something? > > Thanks, > Alexei > > 2007/10/11, Tim Ellison : > > Apologies for the late response ... still catching up. > > > > Aleksey Shipilev wrote: > > > Hi, Paulex, > > > > > >> Amazing work, Aleksey! > > > Thanks, I was waiting for it :) > > > > > >> Seems RI[1] is adapative here, i.e., use epoll when 2.6 kernel is detected, > > >> is it possible for Harmony to implement in similar way? Of course this can > > >> be further work and doesn't necessary to prevent this patch to be applied. > > > I believe it could be done in launcher which could detect the kernel > > > where Harmony starts and then instantiate right SelectorProvider. I > > > don't know the details for Harmony launcher though, it's just the > > > guess. This is in some way contrary with portlib implementation - we > > > could even implement optimized versions for Selector for Windows and > > > Linux separately. > > > > The launcher would not be the right place to detect the kernel version, > > since we would want this to work in all places that the NIO code is > > used, even when people are not using our launcher. > > > > Regards, > > Tim >