Return-Path: X-Original-To: apmail-curator-user-archive@minotaur.apache.org Delivered-To: apmail-curator-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E87D910103 for ; Wed, 11 Sep 2013 03:32:27 +0000 (UTC) Received: (qmail 66310 invoked by uid 500); 11 Sep 2013 03:32:26 -0000 Delivered-To: apmail-curator-user-archive@curator.apache.org Received: (qmail 66278 invoked by uid 500); 11 Sep 2013 03:32:24 -0000 Mailing-List: contact user-help@curator.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@curator.incubator.apache.org Delivered-To: mailing list user@curator.incubator.apache.org Received: (qmail 66268 invoked by uid 99); 11 Sep 2013 03:32:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Sep 2013 03:32:20 +0000 X-ASF-Spam-Status: No, hits=-1998.5 required=5.0 tests=ALL_TRUSTED,HTML_MESSAGE,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 11 Sep 2013 03:32:19 +0000 Received: (qmail 66240 invoked by uid 99); 11 Sep 2013 03:31:59 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Sep 2013 03:31:59 +0000 Received: from localhost (HELO mail-la0-f43.google.com) (127.0.0.1) (smtp-auth username vines, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Sep 2013 03:31:58 +0000 Received: by mail-la0-f43.google.com with SMTP id ep20so6981576lab.16 for ; Tue, 10 Sep 2013 20:31:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=I3X1kDnYMPx9fS8yDmm7x/A7lhIY2lhc9XNqX62f3iQ=; b=c4y7EbWgn7gYGcGXANlIbFulLQ+0AJwWxOubwjpKlaPwGjYAdfLY1GqwTDceIzbZ0z uCfKLwesx7TaMEyd2YwvMhiHir8uLeMGD3tuneLqFAVLlQJ9PXyre/H2VZy6Xai6jP0/ OS0w1g+1njNK2v0d6VzK433h1Wift5FEFCjip2/R2vs4s41fkz6FwT1pqBYPv4fetA6w gca7gGap5B+QqJ3Twbr9MC1tiLUoUCYaMV0KZSsFH4mrnFpZbUL7Bj2jvcKTCV/WG+ue j/bhPcSEUzIK746I5Zijk8nMEEchsv9hDaHJZ6kZckhh71zcwMbgHJEV0JzDhbKSO7P1 Et+g== X-Received: by 10.152.29.201 with SMTP id m9mr24161703lah.6.1378870316902; Tue, 10 Sep 2013 20:31:56 -0700 (PDT) MIME-Version: 1.0 Reply-To: vines@apache.org Received: by 10.114.177.97 with HTTP; Tue, 10 Sep 2013 20:31:16 -0700 (PDT) In-Reply-To: References: From: John Vines Date: Tue, 10 Sep 2013 23:31:16 -0400 Message-ID: Subject: Re: InterProcessReadWriteLock To: user@curator.incubator.apache.org Content-Type: multipart/alternative; boundary=089e0158cb926e319b04e6134349 X-Virus-Checked: Checked by ClamAV on apache.org --089e0158cb926e319b04e6134349 Content-Type: text/plain; charset=ISO-8859-1 Awesome, thanks! On Tue, Sep 10, 2013 at 6:19 PM, Jordan Zimmerman < jordan@jordanzimmerman.com> wrote: > > what happens if I attempt to acquire a write lock while there are read > lock's in position? > The writer waits until all readers release. > > > If the former, will it still block for the reader who's attempting to > claim the writer? > Just like JDK locks, upgrading from a read lock to the write lock is not > possible. That would be a deadlock as the writer will wait indefinitely for > the read to release. > > -JZ > > On Sep 10, 2013, at 5:10 PM, John Vines wrote: > > > Quick question about the behavior of the InterProcessReadWriteLock's > locking behavior- what happens if I attempt to acquire a write lock while > there are read lock's in position? Will it block until the reader's are > released or will it attempt to revoke the reader's locks? If the former, > will it still block for the reader who's attempting to claim the writer? > > > > Thanks > > John > > --089e0158cb926e319b04e6134349 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Awesome, thanks!


<= div class=3D"gmail_quote">On Tue, Sep 10, 2013 at 6:19 PM, Jordan Zimmerman= <jordan@jordanzimmerman.com> wrote:
> what happens if I att= empt to acquire a write lock while there are read lock's in position?
The writer waits until all readers release.

> If the former, will it still block for the reader who's attempting= to claim the writer?
Just like JDK locks, upgrading from a read lock to the write lock is = not possible. That would be a deadlock as the writer will wait indefinitely= for the read to release.

-JZ

On Sep 10, 2013, at 5:10 PM, John Vines <vines@apache.org> wrote:

> Quick question about the behavior of the InterProcessReadWriteLock'= ;s locking behavior- what happens if I attempt to acquire a write lock whil= e there are read lock's in position? Will it block until the reader'= ;s are released or will it attempt to revoke the reader's locks? If the= former, will it still block for the reader who's attempting to claim t= he writer?
>
> Thanks
> John


--089e0158cb926e319b04e6134349--