阅读笔记,这篇文章的实验数据非常漂亮。
In this paper, author proposed a declaarative style of concurrency control.
Programmers demark sections of code which execute within lightweight
software-based transactions that commit atomically and exactly once. And no
performance penalty is incurred for memory accesses outside transactions.
1. CCR Conditional Critical Region
CCR allow programers to indicate what group of operations should be
executed atomically, rather than how to enforce it by some concurrent
control methods.
CCR is popular in teaching, but no good implementations. The key is that
the general form of CCR gives no indication of what specific object to
be accessed, or if a thread blocks at the guard, exactly when it may be
released.
2. This paper map CCRs onto STM which groups together series of memory
accessed and make then appear atomic.
3. This paper implement CCRs for the first time
a. allowing dynamically non-conflicting executions to operate
concurrentlly
b. to re-evaluate CCR conditions only when one of the involved shared
variables may be updated
c. I didnot understood the third advantage.
4. The root of these problems(problems with using lock scheme) is the
imperative style of existing facilities for concurrency control.
Programmers must manually place lock-management operations, hide the
real safety and progress properties that are required.
5. Classical problem of lock is overly pessimistic.
6. This paper's non-blocking sematics is obstruct-freedom.
7. Two design principles
a. CCR should be able to enclose code with as few restrictions as
possible.
b. The system should permits an implementation that does not impose a
high overhead in parts of an application where CCR is not used.
8. The sematics of statements in "atomic" is being executed exactly once.
9. Any field of any object can be accessed in a CCR.
10. In general, native code is not allowed in a CCR. But a few build in
native code is special cases, they are either thread local or relate to
synchronization. They are allow to appear in CCR, needing special handling.
11. Nested CCRs are allowed, they, as a whole, are executed atomically when
all the conditions is true.
12. Mutex is allowed in CCRs, but wait, notify and notifyAll are not allowed
13. Class loading is dissociated from the point within a CCR's execution
which triigers it. We require class loading and initialization to occur at
some point between when a CCR begins and the point at which it appears to
take place atomically(Doesn't this broke the atomic property?)
14. Concurrency Model
If a location is shared between threads, then either
a. all accesses to it must be protected with a mutex
b. all accessed to it must in a CCR
c. it must be marked as volatile
15. Section 4 gives the detailed sematics of atomic construct in Jave.
16. A number of notable features which stem from our requirements
a. No reserved space is needed in the locations being accessed.
b. It requires only word-sized update to be atomic when access heap
locations.
c. The permanent structure used to co-ordinate transactions can be
statically allocated outside the application heap.
d. Outside transactions, accesses to non-volatile heap locations use
standard memory reads and writes.
e. Read operations, whether in transactions or not, donot cause any
update to shared memory.
17. STM provides the following interface
a. Do not allow nesting transactions
b. Accessing memory on a word-addressed basis.
c. a STMWait is implemented to support blocking on the entry of CCR
d. Validate means that the values read represent a consistent snapshot
and locations updated have not been updated by another transaction in an
conflicting way.
18. Structures used
a. Application heap, just like usual
b. ownership records, contain a version number or a id of current owner
c. Transaction descriptor
19. A address has a logical state, that is a pair of value and version
number.
20. orecs are ordinary contain a version number, they refer to a descriptor
only when that transaction is attempting to commit or sleep-- until
STMCommit or STMWait is called. The transaction execution is private,
building up a series of entries in the descriptor which set out the
locations that it has accessed.
21. The skill for designer of concurrent data structures is to aviod
contention hot spots in their data.
阅读(1596) | 评论(1) | 转发(0) |