Return-Path: X-Original-To: apmail-ant-dev-archive@www.apache.org Delivered-To: apmail-ant-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1E50510BF8 for ; Sat, 4 Jan 2014 17:31:39 +0000 (UTC) Received: (qmail 2326 invoked by uid 500); 4 Jan 2014 17:31:38 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 2107 invoked by uid 500); 4 Jan 2014 17:31:37 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 2099 invoked by uid 99); 4 Jan 2014 17:31:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Jan 2014 17:31:36 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of charles@dyfis.net designates 209.85.213.176 as permitted sender) Received: from [209.85.213.176] (HELO mail-ig0-f176.google.com) (209.85.213.176) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Jan 2014 17:31:30 +0000 Received: by mail-ig0-f176.google.com with SMTP id k19so3678279igc.3 for ; Sat, 04 Jan 2014 09:31:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dyfis.net; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=nJT792oe8vl2QHd/pMdgcl80xMDM2WvuJ7xflsrv8Bk=; b=mG0kCID5MHkcdK7HK1+16s/Cfm2C2FQQuNX9+5VmsxdWZjCgvRuKn0RzNKRzL0Oyav lwfq3sHcVCMfdUoPNWYuBxJoZG0QPUwVJzhgQW3w+biengiXkcAxPmKpvHRSwkxhmLAn wWXA2sbYZOCCdcjL0mGwC1GLLDFLCuP3ON5wQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=nJT792oe8vl2QHd/pMdgcl80xMDM2WvuJ7xflsrv8Bk=; b=IXSMo9QorOavn/fKW9h/Top5rHlPxbpWfoO4wlukTrfRSUuw5Hke5ZbuRhO9nvAgvs tad0zOjrOoB9pgdT4wZG2jxnC6HTp+CuW9Y7qb6vRzukRWlS85xPthhC/yi33rQVOj2r 2atw7vLABRR7bX5PtXP49VOlw+MNRUfM7wTRkUpsJELee6F83m9sbjLb2Ttm2zaBnidU JzGow69vBfFObI7pi2YhRG64CGuOGZM/bqiJWb2ST0Zhh/zyemncp9qv1xmX9um3Si2Q aKZEAxRtLCvSax6nBoNHWLoknvrnJB+/6YNtoPCmyYHBlDUS7P/a1iHQhYVN8r3vmqqA mdLw== X-Gm-Message-State: ALoCoQmWYLxWkz/tA2tS/bruAxR1b85t2QwrcgJ2s6ciyX/xUm76+dC3aqQnjIB+3lICsS8lAe4p MIME-Version: 1.0 X-Received: by 10.50.8.67 with SMTP id p3mr9907555iga.6.1388856669005; Sat, 04 Jan 2014 09:31:09 -0800 (PST) Received: by 10.64.8.71 with HTTP; Sat, 4 Jan 2014 09:31:08 -0800 (PST) Received: by 10.64.8.71 with HTTP; Sat, 4 Jan 2014 09:31:08 -0800 (PST) In-Reply-To: <4543AD26-D4B3-47EB-9A8A-F84A7825FF19@hibnet.org> References: <4543AD26-D4B3-47EB-9A8A-F84A7825FF19@hibnet.org> Date: Sat, 4 Jan 2014 11:31:08 -0600 Message-ID: Subject: Re: Cleanup callbacks in IvyContext? From: Charles Duffy To: Ant Developers List Content-Type: multipart/alternative; boundary=089e013d09ae66b00104ef286446 X-Virus-Checked: Checked by ClamAV on apache.org --089e013d09ae66b00104ef286446 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable This is part of why I wouldn't give it knowledge of locks specifically, but simply Runnable callbacks to invoke on pop -- not specifically tied to a single use case. This is not entirely unlike atExit calls available through the JVM, the standard C library, etc. Improving LockStrategy is a necessary component, to be sure -- but something needs to tell it when a read lock is needed, and likewise when its need is past. On Jan 4, 2014 8:07 AM, "Nicolas Lalev=C3=A9e" wrote: > > Le 3 janv. 2014 =C3=A0 22:28, Charles Duffy a =C3=A9c= rit : > > > Howdy, all -- > > > > I'm trying to strengthen Ivy's locking system to make it strong enough = to > > allow ivy:clean at arbitrary times on systems which can have other > actions > > making use of the same shared caches. > > > > There are a few requirements to make this happen while still allowing > > multiple resolves (and like operations) to occur concurrently. One of > those > > is maintaining nonexclusive read locks (as opposed to the write locks > which > > are currently supported), and cleaning them up when necessary. For > > ease-of-implementation, I'm currently proposing to only support this > > behavior when NIO locks (which implicitly support shared locking > semantics) > > are enabled. > > > > To clean these locks up without requiring end-user code to be modified,= I > > propose using the IvyContext stack -- allowing Runnables to be attached > to > > a stack element, and invoking them implicitly when the stack is popped. > > > > > > Because converting a read lock to a write lock is inherently prone to > race > > conditions, we might need to break backwards compatibility with respect > to > > ivy:clean, allowing this to be called only inside a context where no re= ad > > operations have been done -- or breaking read lock semantics by droppin= g > > all read locks before grabbing the write lock. > > > > > > Thoughts? > > My first blind though would be that IvyContext seems to be high level to > handle locking. Couldn't it be done by improving the LockStrategy interfa= ce > so that it also handles read locks ? > > Nicolas > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > For additional commands, e-mail: dev-help@ant.apache.org > > --089e013d09ae66b00104ef286446--