Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2E1A5200B7C for ; Thu, 4 Aug 2016 07:52:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2CE54160A86; Thu, 4 Aug 2016 05:52:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9D9F7160AAA for ; Thu, 4 Aug 2016 07:52:21 +0200 (CEST) Received: (qmail 28735 invoked by uid 500); 4 Aug 2016 05:52:20 -0000 Mailing-List: contact issues-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list issues@ignite.apache.org Received: (qmail 28482 invoked by uid 99); 4 Aug 2016 05:52:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Aug 2016 05:52:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 97D672C0D61 for ; Thu, 4 Aug 2016 05:52:20 +0000 (UTC) Date: Thu, 4 Aug 2016 05:52:20 +0000 (UTC) From: "Vladimir Ozerov (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (IGNITE-1346) Implement striped spin busy lock. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 04 Aug 2016 05:52:22 -0000 [ https://issues.apache.org/jira/browse/IGNITE-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vladimir Ozerov closed IGNITE-1346. ----------------------------------- > Implement striped spin busy lock. > --------------------------------- > > Key: IGNITE-1346 > URL: https://issues.apache.org/jira/browse/IGNITE-1346 > Project: Ignite > Issue Type: Task > Components: general > Affects Versions: 1.1.4 > Reporter: Vladimir Ozerov > Assignee: Vladimir Ozerov > Fix For: 1.6 > > > We have lots of places in code which require "busy" state semantics: > 1) Multiple readers access some resource concurrently setting "busy" state. > 2) At some point a single writer comes, prevents all further readers from accessing the resource, and blocks until all other previous reades are out. > Currently we do that using either GridBusyLock or GridSpinBusyLock. The first one is based on ReentrantReadWriteLock and the second one is based on GridSpinReadWriteLock. > Both implementation have the same performance characteristics, being limited by CPU bus bandwidth when trying to update atomically a shared variable. > Better approach is to "stripe" the lock across multiple variables this minimizing contention between threads. That is, in ideal case each thread increments/decrements his own variable without any contention. Writer will have to iterate over all these variables and block on each until all readers are out. -- This message was sent by Atlassian JIRA (v6.3.4#6332)