-
Notifications
You must be signed in to change notification settings - Fork 14
/
TODO
120 lines (85 loc) · 5.29 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
========== TO DO ==========
17) automatically expand $ to $-tx, $-hwtx or $-notx, and similarly expand
(setf $...) and user-defined functions
16) implement with-lock-elision using hw-only transactions. It must abort if a SW
transaction is running (?), and it must check for a running HW transaction to make it nestable:
(with-lock-elision (lock1)
(with-lock-elision (lock2)
...))
Implement it for both Bordeaux-threads locks and CAS fast mutexes (if available)
15) rewrite GMAP methods as functions
14) implement pools of RBNODE and TNODE - check if benchmarks improve or not
8) optimize ORELSE. The current implementation is quite naive,
it makes a full copy of the current transaction's read and write sets.
DO NOT DO THIS as it discards TXPAIRs pools, reducing performance:
Possible optimization: perform a shallow copy of transaction's read
and write sets, i.e. copy the vectors containing references to TXPAIR
but do NOT clone the TXPAIRs. It works because TXPAIRs are immutable
during a transaction.
========== DONE ==========
23) fix sb-transaction/x86-64-insts.lisp to work with both sbcl >= 1.3.2 and older ones
22) fix (disassemble (lambda () (sb-transaction:transaction-begin)))
21) removed method override on SHARED-INITIALIZE (not allowed by CLOS MOP standard),
overridden instead INITIALIZE-INSTANCE and REINITIALIZE-INSTANCE.
20) renamed $ and (SETF $) to $-SLOT and (SETF $-SLOT).
The functions $ and (SETF $) still exist but now ($ VAR) returns
+UNBOUND-TVAR+ instead of signaling an error if VAR is not bound.
19) (HW-ATOMIC2) now checks for running HW or SW transactions as first thing:
HW transactions **cannot** be started from inside another transaction...
disaster would follow, as HW transactions do not check TVARs values stored
in the TLOG and when committing they write directly into TVARs globaly-visible value.
18bis) optimized adaptive global clock GV6 - it was horribly slow,
wrote to global memory after each commit and rollback
18) implemented adaptive global clock GV6
13) completely rewritten THASH-TABLE from scratch. The old implementation was very slow,
before committing it made a full copy of the original hash table then applied
the changes performed by the transaction.
12) reduced consing in (commit): modified TVARs are added to a TXPAIR list,
replaced versioned-value CONS with two TVAR slots - when writing,
update the version first, then the value - when reading, get the value first,
then the version. Beware of reordering, memory barriers are needed.
11) used global transaction counters to guarantee consistent memory reads.
This solved a big problem that plagues many STM implementations:
a transaction can see an inconsistent view of transactional memory
and start behaving badly (illegal memory accesses, infinite loops...)
before the STM machinery realizes it and re-executes the transaction.
9) contacted Lars Rune Nostdal <larsnostdal at gmail dot com>, author of SW-STM:
see http://blog.nostdal.org/
"I have a very crude and quite horribly written one laying around for
Common Lisp: https://github.com/lnostdal/SW-STM"
He said SW-STM was never finished, and to look elsewhere for STM implementations.
He also agreed to remove SW-STM from cliki.net since it cannot be downloaded from anywhere.
7bis) implemented transactional red-black trees
7) implemented red-black trees (needed for transactional red-black trees)
6bis) implemented (thash-count)
6) implemented transactional hash tables
5) implemented before-commit and after-commit (idea from SW-STM when-commit)
4.2) optimized nested transaction. Copying all the parent TLOG reads and writes is slow,
so merge only reads-of log1 log2 when retrying a nested transaction
and simply replace reads and writes of parent tlog when committing a nested transaction
4.1) tested that errors signalled by an invalid transaction are *not* propagated to the caller
and the transaction is re-executed
4) implemented orelse and nested transactions, including tests
3) (error 'retry-error ...) now shows the message "attempt to RETRY outside ATOMIC block"
when printed
2) in atomic.lisp (run-once) added handler-case to capture errors signaled by a transaction
1) implemented ($ tvar) and (setf ($ tvar) value)
for transactional access to tvars.
useful when dealing directly with tvars,
for example in cases transactional objects are too heavyweight
========== WON'T DO ==========
10) move locks and notifications from a per-slot tvar to per-object data.
Use a single slot or several one in transactional-object ?
FOR THE MOMENT, NO.
it increases code complexity and removes the ability to use raw TVARs from
application code for unclear benefits: no indication that performance
will be better, no significant reduction in memory footprint
(TVARs will need to hold a reference to TOBJ or TSLOT, plus their
index in the object's slots)
4.3) allow orelse/nonblocking to work even without a parent transaction,
i.e. outside (atomic ...) ?
NO.
the overhead of (atomic (orelse ...)) is minimal with respect to bare
(orelse ...), and the former is clearer to understand.
Also, doing this would make orelse implementation slower and even more
complicated than what already is.