Path: csiph.com!feeder.erje.net!1.eu.feeder.erje.net!news.albasani.net!.POSTED!not-for-mail From: j4n bur53 Newsgroups: comp.lang.java.programmer Subject: Re: Library for Escalable Locks, Slimmest API? Date: Mon, 8 Aug 2016 09:47:39 +0200 Organization: albasani.net Lines: 27 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net wDeprcqf4EdnDIYB7E6nkkDo+IjiZ8FqihSi3bDoAViER0HboROrrogTtN2AUa5Oqry1eRWIetobgxwrtd2K0A== NNTP-Posting-Date: Mon, 8 Aug 2016 07:47:40 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="xL/aUCBOR8PlZ7PaiiwlXXmnvuqL+6BPfZoL3UpyeoV4NJvRQZba8NWbIRV/JmK2k+o6QLeGSEJ+iBgr4FntYIkrbNmQC01/WDlIRZUWEfwA0MM9MUmyEz7n4XO8Nr8D"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40 In-Reply-To: Cancel-Lock: sha1:3sXOxLtBtobM+qo89gzxHIp1Y7w= Xref: csiph.com comp.lang.java.programmer:35228 Hi Andreas, j4n bur53 schrieb: > It is needed in a context with less consistency constraints. I > only want to assure that some datastructure is not damaged, the > end-user can still implement his domain consistency. BTW consistency issues only appear if you have multiple locks. Escalating from read to write is perfectly fine, since when you had the read lock anyway no other thread could obtain the write lock in the past. So this fits your: "If instead you have a big number of "only-examiners" and just one "eventually updater", then such an upgradeable lock could be really useful." So consistency is automatically assured, also with escalable locks, you don't need to leave the context. The issue is only there if you have multiple regions, respectively multiple locks. If there are multiple regions then there is indeed inter- ference, which can have many different incarnations! Bye