- 浏览: 156914 次
文章分类
最新评论
-
飘零雪:
[b][/b][i][/i][u][/u]引用
自定义Mave archetype的创建 -
fujohnwang:
<div class="quote_title ...
基于iBatis的开源分布式数据访问层 -
gzenzen:
<pre name="code" c ...
基于iBatis的开源分布式数据访问层 -
fujohnwang:
bornwan 写道我就很想知道分布式数据源,水平切分之后排序 ...
基于iBatis的开源分布式数据访问层 -
fujohnwang:
gzenzen 写道什么时候支持mybatis3、spring ...
基于iBatis的开源分布式数据访问层
3- Concurrency Share (Concurrency Made Easy)
3.1 why concurrency?
1 - 为了反应一些问题的逻辑结构(reflect the logical structures of some problems)
2 - 为了应对相互独立的多台物理设备(to manange multiple independent devices)
3 - 通过同时在多部处理器上运行以题高性能(improve computing performance)
3.1 the benefits to use concurrency
3.1.1 reduce latency
(divide and conquer, splitting one task into multiple smaller ones that's to be executed in concurrency makes it complete faster and therefore will reduce latency)
3.1.2 hide latency (in task is blocking on some long-run operations, the concurrency can hide the long-run operations by swithc to do other tasks at the mean time)
concurrency is not the only option to do this, other options including:
3.1.2.1 nonblocking operations(eg. asynchronous IO)
3.1.2.2 an event-loop(poll()/select() on Unix)
3.1.3 increase throughtput (more tasks can be processed without wasting computing power)
3.2 concurrency models
3.2.1 Share-State Concurrency
1- equipments or ways to control concurrency
1 immutable
2 confinement
thread-confinement
thread-specific storage (ThreadLocal in Java)
stack confinement
method confinement
3 lock-based concurrency (locks and condition variables)
common gotchas
deadlocks (solution: resource re-ordering, interval retry)
livelocks
tuning locks:
reduce time of holding locks
break glabal locks to fine-grained ones
4 atomic variables(CAS)
Java5 java.util.concurrency.atomic.*
5 STM (Software Transaction Memory)
concept
tx operations execute in their own thread in parallel, commit will cause one to be successful and others abort and retry.
languages or platform that support STM:
Clojure
Concurrent Haskell
STM.NET
2- conclusion on this type concurrency
1 perssimistic strategy (e.g. Lock, pin-loop, blocking)
1 situation suitable
- high contention situations
2 optimistic strategy (e.g. CAS(Compare And Swap/Set), STM)
1 situation suitable
- low or middle contention situations
3.2.2 Share-Nothing Concurrency / Message-Passing Concurrency( parallel processing)
Actor Model Concurrency
(1) change its internal state,
(2) send messages to peer actors,
(3) create new actors, and/or
(4) migrate to another computing host.
representative languages
Erlang
Scala
disadvantages
not suitable when we really want to share something between co-workers(threads or processes)
3.2.3 Dataflow/Declaritive Concurrency (can be under share-state concurrency too)
1- single-assignment variable
2- data-state trigger the process flow
注: 只是一些点的记录和总结,最终成文时可能还会调整, 请持怀疑的态度阅读和采纳。
---------------------------------------------------------
发表评论
-
基于iBatis的开源分布式数据访问层
2011-03-28 11:46 5539http://code.alibabatech.com/wik ... -
分布式数据访问与同步场景浅析
2010-09-06 19:50 2241分布式数据访 ... -
Netty Framework Tips And Gotchas
2010-08-11 18:01 2666王福强(Darren.W ... -
有关Maven编译DeprecatedAPI失败的问题
2010-08-02 10:59 4473在项目代码里用了sun.misc.Signal ... -
Java Daemon Control
2010-07-27 17:50 2909Java Daemon Control ... -
Event Driven Style API Design Instead of Old Procedure Style Ones
2010-07-12 19:53 1475王福强(Darren.Wang) <f ... -
HA狭义与广义论
2010-07-09 09:25 1466Author: Darren Wang(fujohnwang) ... -
Why We Need A Global ID Generator?!
2010-05-18 13:01 1628Table of Contents 1. Pai ... -
Gotchas With JUnit's Execution Model
2010-03-26 09:22 1055Maybe you have known it before, ... -
Transaction Management Patterns In Brief
2010-02-09 10:27 1763There are several patte ... -
"扩展Spring的依赖注入行为"两例
2009-12-26 12:59 2732扩展Spring的依赖注入行为两例 ... -
框架API设计相关的碎言
2009-11-17 09:32 1614框架的API设计,应该是 ... -
自定义Mave archetype的创建
2009-10-29 20:12 12360Table of Contents ... -
看来有人已经有要抢先推出这个节目的意思了
2009-10-27 19:29 1019这篇blog对java, clojure和scala中的并发处 ... -
Roma Documentation Outline
2009-10-27 17:35 150Roma Docume ... -
Hot Stuff - Lombok
2009-10-22 19:46 1028give it a try, it's really cool ... -
ROMA框架潜在改进点思考(Thinking in ROMA improvements)
2009-10-21 19:53 1931. 关于ROMA现有表单 ... -
Valang Validator under the hood
2009-10-19 13:29 1660Table of Contents 1. Va ... -
ThreadSafety, Non-ThreadSafety 与 Stateless, Stateful有必然的对应关系吗?
2009-10-09 09:11 1862“It depends. ” 我们 ... -
尴尬的COC
2009-08-25 11:04 994Convention Over Configurati ...
相关推荐
为了解决这些问题,Kung 和 Robinson 提出了乐观并发控制方法(Optimistic Concurrency Control)。 #### 乐观并发控制概述 乐观并发控制是一种非锁定型的并发控制策略,它假设事务之间很少发生冲突。这种方法的...
Next, you will move on to create streams and use all their intermediate and terminal operations to process big collections of data in a parallel and functional way. Further, you'll discover a whole ...
* Parallel streams to process big sets of data in a parallel way, including the new Java 9 reactive streams * Data structures for concurrent programs * Adapting the default behavior of some ...
本文讨论了乐观锁协议在数据库系统中的并发控制问题。在数据库系统的并发控制中,传统的解决方案依赖于对数据对象的加锁。然而,本文提出了两种非锁定并发控制的方法。这些方法被称作“乐观”的并发控制机制,之所以...
Python Concurrency with asyncio
Herb Sutter is a leading authority on software development. He is the best selling author of Exceptional C++ as well as three other books and hundreds of technical papers and articles, including the ...
《Programming Concurrency on the JVM》这本书针对Java虚拟机(JVM)平台上的并发编程进行了深入探讨,为开发者提供了一系列实用的指导和示例。本文将根据该书的部分内容和读者反馈,总结出几个关键的知识点,帮助...
a decade of concurrency
Concurrency is always a challenge for developers and writing concurrent programs can be extremely hard. There is a number of things that could potentially blow up and the complexity of systems rises ...
Part 1 focuses on the Thread APIs and Part 2 focuses on the concurrency utilities. In Part 1, you learn about Thread API basics and runnables, synchronization and volatility, waiting and notification...
Java Concurrency in practice
I had one major goal in writing this book: to cover modern approaches to concurrency. There are a hundred books out there that describe threads and all the various synchronization primitives in ...