Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 84263 invoked from network); 5 Apr 2005 09:01:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Apr 2005 09:01:51 -0000 Received: (qmail 97246 invoked by uid 500); 5 Apr 2005 09:01:44 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 96986 invoked by uid 500); 5 Apr 2005 09:01:43 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 96969 invoked by uid 99); 5 Apr 2005 09:01:43 -0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE,RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of oliver.zeigermann@gmail.com designates 64.233.184.206 as permitted sender) Received: from wproxy.gmail.com (HELO wproxy.gmail.com) (64.233.184.206) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 05 Apr 2005 02:01:39 -0700 Received: by wproxy.gmail.com with SMTP id 71so1849833wri for ; Tue, 05 Apr 2005 02:01:38 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=FgIAzYN352t7V6dmIOyhuiGkibuToZYVr/NlEtDK/IPXDmgnqaXV5F8QHj/v5+y7P5YAKj5qnKSuq3+vBttW22h9JSNCE4ZJLoqjMNT0untSYnDZCvN7vG7KzsbxNaIDaM6GvOVfHAmLMhq7FPDvF2z03wqC7dCKtvgBZj0z7mY= Received: by 10.54.84.18 with SMTP id h18mr570893wrb; Tue, 05 Apr 2005 02:01:38 -0700 (PDT) Received: by 10.54.101.4 with HTTP; Tue, 5 Apr 2005 02:01:38 -0700 (PDT) Message-ID: <9da4f452050405020111c2316b@mail.gmail.com> Date: Tue, 5 Apr 2005 11:01:38 +0200 From: Oliver Zeigermann Reply-To: ozeigermann@apache.org To: Jakarta Commons Users List Subject: Re: [transaction.locking]Want to lock intervals In-Reply-To: <1112690811.4252507b553e9@webmail2.utbm.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit References: <1112690811.4252507b553e9@webmail2.utbm.fr> X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Mel, I suppose you pass the interval as the resourceId, right? The problem is that normally a single locks gets assigned to a resourceid. I do not think there is an easy solution if your intervals are not discrete. But if they are you could just enumerate all values as resourceIds and try to lock check each and every of them. This would of course require writing your own lock manager, but that shouldn't be too hard. Oliver On Apr 5, 2005 10:46 AM, Melanie.Bats@UTBM.fr wrote: > Hi, > > I want to use the ReadWriteLockManager and ReadWriteLock on interval. To > facilitate the operation on interval I use the package xxl.core.util.Interval1D. > > The LockManager works well if I try to get and release locks on same interval. > For example, a first thread T1 get a ReadLock on the interval I[1, 122] and then > a second thread T2 try to obtain a WriteLock on I, T2 will wait until T1 release > its lock on I. > > The LockManager does not work well in this case : a first thread T1 get a > ReadLock on the interval I1[1 , 5] and then a second thread T2 try to obtain a > WriteLock on I2[4 , 7], T2 will obtain is lock and we will have incompatible > locks on the intersection of I1 and I2 [4, 5]. > > The problem is that I1 and I2 are two different objects for the LockManager. > > Is that possible to modify the ReadWriteLock and the ReadWriteLockManager, in > order to determine when intervals intersect. It must verify the compatibility of > the lock or wait for the release when it is incompatible ? > > I expect I am clear, if not ask me for details :o) > > Thanks for your help, > > Mel > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org