libitm.info 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308
  1. This is libitm.info, produced by makeinfo version 6.5 from libitm.texi.
  2. Copyright (C) 2011-2020 Free Software Foundation, Inc.
  3. Permission is granted to copy, distribute and/or modify this document
  4. under the terms of the GNU Free Documentation License, Version 1.2 or
  5. any later version published by the Free Software Foundation; with no
  6. Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
  7. copy of the license is included in the section entitled "GNU Free
  8. Documentation License".
  9. INFO-DIR-SECTION GNU Libraries
  10. START-INFO-DIR-ENTRY
  11. * libitm: (libitm). GNU Transactional Memory Library
  12. END-INFO-DIR-ENTRY
  13. This manual documents the GNU Transactional Memory Library.
  14. Copyright (C) 2011-2020 Free Software Foundation, Inc.
  15. Permission is granted to copy, distribute and/or modify this document
  16. under the terms of the GNU Free Documentation License, Version 1.2 or
  17. any later version published by the Free Software Foundation; with no
  18. Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
  19. copy of the license is included in the section entitled "GNU Free
  20. Documentation License".
  21. 
  22. File: libitm.info, Node: Top, Next: Enabling libitm, Up: (dir)
  23. Introduction
  24. ************
  25. This manual documents the usage and internals of libitm, the GNU
  26. Transactional Memory Library. It provides transaction support for
  27. accesses to a process' memory, enabling easy-to-use synchronization of
  28. accesses to shared memory by several threads.
  29. * Menu:
  30. * Enabling libitm:: How to enable libitm for your applications.
  31. * C/C++ Language Constructs for TM::
  32. Notes on the language-level interface supported
  33. by gcc.
  34. * The libitm ABI:: Notes on the external ABI provided by libitm.
  35. * Internals:: Notes on libitm's internal synchronization.
  36. * GNU Free Documentation License::
  37. How you can copy and share this manual.
  38. * Library Index:: Index of this documentation.
  39. 
  40. File: libitm.info, Node: Enabling libitm, Next: C/C++ Language Constructs for TM, Prev: Top, Up: Top
  41. 1 Enabling libitm
  42. *****************
  43. To activate support for TM in C/C++, the compile-time flag '-fgnu-tm'
  44. must be specified. This enables TM language-level constructs such as
  45. transaction statements (e.g., '__transaction_atomic', *note C/C++
  46. Language Constructs for TM:: for details).
  47. 
  48. File: libitm.info, Node: C/C++ Language Constructs for TM, Next: The libitm ABI, Prev: Enabling libitm, Up: Top
  49. 2 C/C++ Language Constructs for TM
  50. **********************************
  51. Transactions are supported in C++ and C in the form of transaction
  52. statements, transaction expressions, and function transactions. In the
  53. following example, both 'a' and 'b' will be read and the difference will
  54. be written to 'c', all atomically and isolated from other transactions:
  55. __transaction_atomic { c = a - b; }
  56. Therefore, another thread can use the following code to concurrently
  57. update 'b' without ever causing 'c' to hold a negative value (and
  58. without having to use other synchronization constructs such as locks or
  59. C++11 atomics):
  60. __transaction_atomic { if (a > b) b++; }
  61. GCC follows the Draft Specification of Transactional Language
  62. Constructs for C++ (v1.1)
  63. (https://sites.google.com/site/tmforcplusplus/) in its implementation of
  64. transactions.
  65. The precise semantics of transactions are defined in terms of the
  66. C++11/C11 memory model (see the specification). Roughly, transactions
  67. provide synchronization guarantees that are similar to what would be
  68. guaranteed when using a single global lock as a guard for all
  69. transactions. Note that like other synchronization constructs in C/C++,
  70. transactions rely on a data-race-free program (e.g., a nontransactional
  71. write that is concurrent with a transactional read to the same memory
  72. location is a data race).
  73. 
  74. File: libitm.info, Node: The libitm ABI, Next: Internals, Prev: C/C++ Language Constructs for TM, Up: Top
  75. 3 The libitm ABI
  76. ****************
  77. The ABI provided by libitm is basically equal to the Linux variant of
  78. Intel's current TM ABI specification document (Revision 1.1, May 6 2009)
  79. but with the differences listed in this chapter. It would be good if
  80. these changes would eventually be merged into a future version of this
  81. specification. To ease look-up, the following subsections mirror the
  82. structure of this specification.
  83. 3.1 [No changes] Objectives
  84. ===========================
  85. 3.2 [No changes] Non-objectives
  86. ===============================
  87. 3.3 Library design principles
  88. =============================
  89. 3.3.1 [No changes] Calling conventions
  90. --------------------------------------
  91. 3.3.2 [No changes] TM library algorithms
  92. ----------------------------------------
  93. 3.3.3 [No changes] Optimized load and store routines
  94. ----------------------------------------------------
  95. 3.3.4 [No changes] Aligned load and store routines
  96. --------------------------------------------------
  97. 3.3.5 Data logging functions
  98. ----------------------------
  99. The memory locations accessed with transactional loads and stores and
  100. the memory locations whose values are logged must not overlap. This
  101. required separation only extends to the scope of the execution of one
  102. transaction including all the executions of all nested transactions.
  103. The compiler must be consistent (within the scope of a single
  104. transaction) about which memory locations are shared and which are not
  105. shared with other threads (i.e., data must be accessed either
  106. transactionally or nontransactionally). Otherwise, non-write-through TM
  107. algorithms would not work.
  108. For memory locations on the stack, this requirement extends to only
  109. the lifetime of the stack frame that the memory location belongs to (or
  110. the lifetime of the transaction, whichever is shorter). Thus, memory
  111. that is reused for several stack frames could be target of both data
  112. logging and transactional accesses; however, this is harmless because
  113. these stack frames' lifetimes will end before the transaction finishes.
  114. 3.3.6 [No changes] Scatter/gather calls
  115. ---------------------------------------
  116. 3.3.7 [No changes] Serial and irrevocable mode
  117. ----------------------------------------------
  118. 3.3.8 [No changes] Transaction descriptor
  119. -----------------------------------------
  120. 3.3.9 Store allocation
  121. ----------------------
  122. There is no 'getTransaction' function.
  123. 3.3.10 [No changes] Naming conventions
  124. --------------------------------------
  125. 3.3.11 Function pointer encryption
  126. ----------------------------------
  127. Currently, this is not implemented.
  128. 3.4 Types and macros list
  129. =========================
  130. '_ITM_codeProperties' has changed, *note Starting a transaction:
  131. txn-code-properties. '_ITM_srcLocation' is not used.
  132. 3.5 Function list
  133. =================
  134. 3.5.1 Initialization and finalization functions
  135. -----------------------------------------------
  136. These functions are not part of the ABI.
  137. 3.5.2 [No changes] Version checking
  138. -----------------------------------
  139. 3.5.3 [No changes] Error reporting
  140. ----------------------------------
  141. 3.5.4 [No changes] inTransaction call
  142. -------------------------------------
  143. 3.5.5 State manipulation functions
  144. ----------------------------------
  145. There is no 'getTransaction' function. Transaction identifiers for
  146. nested transactions will be ordered but not necessarily sequential
  147. (i.e., for a nested transaction's identifier IN and its enclosing
  148. transaction's identifier IE, it is guaranteed that IN >= IE).
  149. 3.5.6 [No changes] Source locations
  150. -----------------------------------
  151. 3.5.7 Starting a transaction
  152. ----------------------------
  153. 3.5.7.1 Transaction code properties
  154. ...................................
  155. The bit 'hasNoXMMUpdate' is instead called 'hasNoVectorUpdate'. Iff it
  156. is set, vector register save/restore is not necessary for any target
  157. machine.
  158. The 'hasNoFloatUpdate' bit ('0x0010') is new. Iff it is set,
  159. floating point register save/restore is not necessary for any target
  160. machine.
  161. 'undoLogCode' is not supported and a fatal runtime error will be
  162. raised if this bit is set. It is not properly defined in the ABI why
  163. barriers other than undo logging are not present; Are they not necessary
  164. (e.g., a transaction operating purely on thread-local data) or have they
  165. been omitted by the compiler because it thinks that some kind of global
  166. synchronization (e.g., serial mode) might perform better? The
  167. specification suggests that the latter might be the case, but the former
  168. seems to be more useful.
  169. The 'readOnly' bit ('0x4000') is new. *TODO* Lexical or dynamic
  170. scope?
  171. 'hasNoRetry' is not supported. If this bit is not set, but
  172. 'hasNoAbort' is set, the library can assume that transaction rollback
  173. will not be requested.
  174. It would be useful if the absence of externally-triggered rollbacks
  175. would be reported for the dynamic scope as well, not just for the
  176. lexical scope ('hasNoAbort'). Without this, a library cannot exploit
  177. this together with flat nesting.
  178. 'exceptionBlock' is not supported because exception blocks are not
  179. used.
  180. 3.5.7.2 [No changes] Windows exception state
  181. ............................................
  182. 3.5.7.3 [No changes] Other machine state
  183. ........................................
  184. 3.5.7.4 [No changes] Results from beginTransaction
  185. ..................................................
  186. 3.5.8 Aborting a transaction
  187. ----------------------------
  188. '_ITM_rollbackTransaction' is not supported. '_ITM_abortTransaction' is
  189. supported but the abort reasons 'exceptionBlockAbort', 'TMConflict', and
  190. 'userRetry' are not supported. There are no exception blocks in
  191. general, so the related cases also do not have to be considered. To
  192. encode '__transaction_cancel [[outer]]', compilers must set the new
  193. 'outerAbort' bit ('0x10') additionally to the 'userAbort' bit in the
  194. abort reason.
  195. 3.5.9 Committing a transaction
  196. ------------------------------
  197. The exception handling (EH) scheme is different. The Intel ABI requires
  198. the '_ITM_tryCommitTransaction' function that will return even when the
  199. commit failed and will have to be matched with calls to either
  200. '_ITM_abortTransaction' or '_ITM_commitTransaction'. In contrast, gcc
  201. relies on transactional wrappers for the functions of the Exception
  202. Handling ABI and on one additional commit function (shown below). This
  203. allows the TM to keep track of EH internally and thus it does not have
  204. to embed the cleanup of EH state into the existing EH code in the
  205. program. '_ITM_tryCommitTransaction' is not supported.
  206. '_ITM_commitTransactionToId' is also not supported because the
  207. propagation of thrown exceptions will not bypass commits of nested
  208. transactions.
  209. void _ITM_commitTransactionEH(void *exc_ptr) ITM_REGPARM;
  210. void *_ITM_cxa_allocate_exception (size_t);
  211. void _ITM_cxa_free_exception (void *exc_ptr);
  212. void _ITM_cxa_throw (void *obj, void *tinfo, void (*dest) (void *));
  213. void *_ITM_cxa_begin_catch (void *exc_ptr);
  214. void _ITM_cxa_end_catch (void);
  215. The EH scheme changed in version 6 of GCC. Previously, the compiler
  216. added a call to '_ITM_commitTransactionEH' to commit a transaction if an
  217. exception could be in flight at this position in the code; 'exc_ptr' is
  218. the address of the current exception and must be non-zero. Now, the
  219. compiler must catch all exceptions that are about to be thrown out of a
  220. transaction and call '_ITM_commitTransactionEH' from the catch clause,
  221. with 'exc_ptr' being zero.
  222. Note that the old EH scheme never worked completely in GCC's
  223. implementation; libitm currently does not try to be compatible with the
  224. old scheme.
  225. The '_ITM_cxa...' functions are transactional wrappers for the
  226. respective '__cxa...' functions and must be called instead of these in
  227. transactional code. '_ITM_cxa_free_exception' is new in GCC 6.
  228. To support this EH scheme, libstdc++ needs to provide one additional
  229. function ('_cxa_tm_cleanup'), which is used by the TM to clean up the
  230. exception handling state while rolling back a transaction:
  231. void __cxa_tm_cleanup (void *unthrown_obj, void *cleanup_exc,
  232. unsigned int caught_count);
  233. Since GCC 6, 'unthrown_obj' is not used anymore and always null;
  234. prior to that, 'unthrown_obj' is non-null if the program called
  235. '__cxa_allocate_exception' for this exception but did not yet called
  236. '__cxa_throw' for it. 'cleanup_exc' is non-null if the program is
  237. currently processing a cleanup along an exception path but has not
  238. caught this exception yet. 'caught_count' is the nesting depth of
  239. '__cxa_begin_catch' within the transaction (which can be counted by the
  240. TM using '_ITM_cxa_begin_catch' and '_ITM_cxa_end_catch');
  241. '__cxa_tm_cleanup' then performs rollback by essentially performing
  242. '__cxa_end_catch' that many times.
  243. 3.5.10 Exception handling support
  244. ---------------------------------
  245. Currently, there is no support for functionality like
  246. '__transaction_cancel throw' as described in the C++ TM specification.
  247. Supporting this should be possible with the EH scheme explained
  248. previously because via the transactional wrappers for the EH ABI, the TM
  249. is able to observe and intercept EH.
  250. 3.5.11 [No changes] Transition to serial-irrevocable mode
  251. ---------------------------------------------------------
  252. 3.5.12 [No changes] Data transfer functions
  253. -------------------------------------------
  254. 3.5.13 [No changes] Transactional memory copies
  255. -----------------------------------------------
  256. 3.5.14 Transactional versions of memmove
  257. ----------------------------------------
  258. If either the source or destination memory region is to be accessed
  259. nontransactionally, then source and destination regions must not be
  260. overlapping. The respective '_ITM_memmove' functions are still
  261. available but a fatal runtime error will be raised if such regions do
  262. overlap. To support this functionality, the ABI would have to specify
  263. how the intersection of the regions has to be accessed (i.e.,
  264. transactionally or nontransactionally).
  265. 3.5.15 [No changes] Transactional versions of memset
  266. ----------------------------------------------------
  267. 3.5.16 [No changes] Logging functions
  268. -------------------------------------
  269. 3.5.17 User-registered commit and undo actions
  270. ----------------------------------------------
  271. Commit actions will get executed in the same order in which the
  272. respective calls to '_ITM_addUserCommitAction' happened. Only
  273. '_ITM_noTransactionId' is allowed as value for the
  274. 'resumingTransactionId' argument. Commit actions get executed after
  275. privatization safety has been ensured.
  276. Undo actions will get executed in reverse order compared to the order
  277. in which the respective calls to '_ITM_addUserUndoAction' happened. The
  278. ordering of undo actions w.r.t. the roll-back of other actions (e.g.,
  279. data transfers or memory allocations) is undefined.
  280. '_ITM_getThreadnum' is not supported currently because its only
  281. purpose is to provide a thread ID that matches some assumed performance
  282. tuning output, but this output is not part of the ABI nor further
  283. defined by it.
  284. '_ITM_dropReferences' is not supported currently because its
  285. semantics and the intention behind it is not entirely clear. The
  286. specification suggests that this function is necessary because of
  287. certain orderings of data transfer undos and the releasing of memory
  288. regions (i.e., privatization). However, this ordering is never defined,
  289. nor is the ordering of dropping references w.r.t. other events.
  290. 3.5.18 [New] Transactional indirect calls
  291. -----------------------------------------
  292. Indirect calls (i.e., calls through a function pointer) within
  293. transactions should execute the transactional clone of the original
  294. function (i.e., a clone of the original that has been fully instrumented
  295. to use the TM runtime), if such a clone is available. The runtime
  296. provides two functions to register/deregister clone tables:
  297. struct clone_entry
  298. {
  299. void *orig, *clone;
  300. };
  301. void _ITM_registerTMCloneTable (clone_entry *table, size_t entries);
  302. void _ITM_deregisterTMCloneTable (clone_entry *table);
  303. Registered tables must be writable by the TM runtime, and must be
  304. live throughout the life-time of the TM runtime.
  305. *TODO* The intention was always to drop the registration functions
  306. entirely, and create a new ELF Phdr describing the linker-sorted table.
  307. Much like what currently happens for 'PT_GNU_EH_FRAME'. This work kept
  308. getting bogged down in how to represent the N different code generation
  309. variants. We clearly needed at least two--SW and HW transactional
  310. clones--but there was always a suggestion of more variants for different
  311. TM assumptions/invariants.
  312. The compiler can then use two TM runtime functions to perform
  313. indirect calls in transactions:
  314. void *_ITM_getTMCloneOrIrrevocable (void *function) ITM_REGPARM;
  315. void *_ITM_getTMCloneSafe (void *function) ITM_REGPARM;
  316. If there is a registered clone for supplied function, both will
  317. return a pointer to the clone. If not, the first runtime function will
  318. attempt to switch to serial-irrevocable mode and return the original
  319. pointer, whereas the second will raise a fatal runtime error.
  320. 3.5.19 [New] Transactional dynamic memory management
  321. ----------------------------------------------------
  322. void *_ITM_malloc (size_t)
  323. __attribute__((__malloc__)) ITM_PURE;
  324. void *_ITM_calloc (size_t, size_t)
  325. __attribute__((__malloc__)) ITM_PURE;
  326. void _ITM_free (void *) ITM_PURE;
  327. These functions are essentially transactional wrappers for 'malloc',
  328. 'calloc', and 'free'. Within transactions, the compiler should replace
  329. calls to the original functions with calls to the wrapper functions.
  330. libitm also provides transactional clones of C++ memory management
  331. functions such as global operator new and delete. They are part of
  332. libitm for historic reasons but do not need to be part of this ABI.
  333. 3.6 [No changes] Future Enhancements to the ABI
  334. ===============================================
  335. 3.7 Sample code
  336. ===============
  337. The code examples might not be correct w.r.t. the current version of
  338. the ABI, especially everything related to exception handling.
  339. 3.8 [New] Memory model
  340. ======================
  341. The ABI should define a memory model and the ordering that is guaranteed
  342. for data transfers and commit/undo actions, or at least refer to another
  343. memory model that needs to be preserved. Without that, the compiler
  344. cannot ensure the memory model specified on the level of the programming
  345. language (e.g., by the C++ TM specification).
  346. For example, if a transactional load is ordered before another
  347. load/store, then the TM runtime must also ensure this ordering when
  348. accessing shared state. If not, this might break the kind of
  349. publication safety used in the C++ TM specification. Likewise, the TM
  350. runtime must ensure privatization safety.
  351. 
  352. File: libitm.info, Node: Internals, Next: GNU Free Documentation License, Prev: The libitm ABI, Up: Top
  353. 4 Internals
  354. ***********
  355. 4.1 TM methods and method groups
  356. ================================
  357. libitm supports several ways of synchronizing transactions with each
  358. other. These TM methods (or TM algorithms) are implemented in the form
  359. of subclasses of 'abi_dispatch', which provide methods for transactional
  360. loads and stores as well as callbacks for rollback and commit. All
  361. methods that are compatible with each other (i.e., that let concurrently
  362. running transactions still synchronize correctly even if different
  363. methods are used) belong to the same TM method group. Pointers to TM
  364. methods can be obtained using the factory methods prefixed with
  365. 'dispatch_' in 'libitm_i.h'. There are two special methods,
  366. 'dispatch_serial' and 'dispatch_serialirr', that are compatible with all
  367. methods because they run transactions completely in serial mode.
  368. 4.1.1 TM method life cycle
  369. --------------------------
  370. The state of TM methods does not change after construction, but they do
  371. alter the state of transactions that use this method. However, because
  372. per-transaction data gets used by several methods, 'gtm_thread' is
  373. responsible for setting an initial state that is useful for all methods.
  374. After that, methods are responsible for resetting/clearing this state on
  375. each rollback or commit (of outermost transactions), so that the
  376. transaction executed next is not affected by the previous transaction.
  377. There is also global state associated with each method group, which
  378. is initialized and shut down ('method_group::init()' and 'fini()') when
  379. switching between method groups (see 'retry.cc').
  380. 4.1.2 Selecting the default method
  381. ----------------------------------
  382. The default method that libitm uses for freshly started transactions
  383. (but not necessarily for restarted transactions) can be set via an
  384. environment variable ('ITM_DEFAULT_METHOD'), whose value should be equal
  385. to the name of one of the factory methods returning abi_dispatch
  386. subclasses but without the "dispatch_" prefix (e.g., "serialirr" instead
  387. of 'GTM::dispatch_serialirr()').
  388. Note that this environment variable is only a hint for libitm and
  389. might not be supported in the future.
  390. 4.2 Nesting: flat vs. closed
  391. ============================
  392. We support two different kinds of nesting of transactions. In the case
  393. of _flat nesting_, the nesting structure is flattened and all nested
  394. transactions are subsumed by the enclosing transaction. In contrast,
  395. with _closed nesting_, nested transactions that have not yet committed
  396. can be rolled back separately from the enclosing transactions; when they
  397. commit, they are subsumed by the enclosing transaction, and their
  398. effects will be finally committed when the outermost transaction
  399. commits. _Open nesting_ (where nested transactions can commit
  400. independently of the enclosing transactions) are not supported.
  401. Flat nesting is the default nesting mode, but closed nesting is
  402. supported and used when transactions contain user-controlled aborts
  403. ('__transaction_cancel' statements). We assume that user-controlled
  404. aborts are rare in typical code and used mostly in exceptional
  405. situations. Thus, it makes more sense to use flat nesting by default to
  406. avoid the performance overhead of the additional checkpoints required
  407. for closed nesting. User-controlled aborts will correctly abort the
  408. innermost enclosing transaction, whereas the whole (i.e., outermost)
  409. transaction will be restarted otherwise (e.g., when a transaction
  410. encounters data conflicts during optimistic execution).
  411. 4.3 Locking conventions
  412. =======================
  413. This section documents the locking scheme and rules for all uses of
  414. locking in libitm. We have to support serial(-irrevocable) mode, which
  415. is implemented using a global lock as explained next (called the _serial
  416. lock_). To simplify the overall design, we use the same lock as
  417. catch-all locking mechanism for other infrequent tasks such as
  418. (de)registering clone tables or threads. Besides the serial lock, there
  419. are _per-method-group locks_ that are managed by specific method groups
  420. (i.e., groups of similar TM concurrency control algorithms), and
  421. lock-like constructs for quiescence-based operations such as ensuring
  422. privatization safety.
  423. Thus, the actions that participate in the libitm-internal locking are
  424. either _active transactions_ that do not run in serial mode, _serial
  425. transactions_ (which (are about to) run in serial mode), and management
  426. tasks that do not execute within a transaction but have acquired the
  427. serial mode like a serial transaction would do (e.g., to be able to
  428. register threads with libitm). Transactions become active as soon as
  429. they have successfully used the serial lock to announce this globally
  430. (*note Serial lock implementation: serial-lock-impl.). Likewise,
  431. transactions become serial transactions as soon as they have acquired
  432. the exclusive rights provided by the serial lock (i.e., serial mode,
  433. which also means that there are no other concurrent active or serial
  434. transactions). Note that active transactions can become serial
  435. transactions when they enter serial mode during the runtime of the
  436. transaction.
  437. 4.3.1 State-to-lock mapping
  438. ---------------------------
  439. Application data is protected by the serial lock if there is a serial
  440. transaction and no concurrently running active transaction (i.e.,
  441. non-serial). Otherwise, application data is protected by the currently
  442. selected method group, which might use per-method-group locks or other
  443. mechanisms. Also note that application data that is about to be
  444. privatized might not be allowed to be accessed by nontransactional code
  445. until privatization safety has been ensured; the details of this are
  446. handled by the current method group.
  447. libitm-internal state is either protected by the serial lock or
  448. accessed through custom concurrent code. The latter applies to the
  449. public/shared part of a transaction object and most typical
  450. method-group-specific state.
  451. The former category (protected by the serial lock) includes:
  452. * The list of active threads that have used transactions.
  453. * The tables that map functions to their transactional clones.
  454. * The current selection of which method group to use.
  455. * Some method-group-specific data, or invariants of this data. For
  456. example, resetting a method group to its initial state is handled
  457. by switching to the same method group, so the serial lock protects
  458. such resetting as well.
  459. In general, such state is immutable whenever there exists an active
  460. (non-serial) transaction. If there is no active transaction, a serial
  461. transaction (or a thread that is not currently executing a transaction
  462. but has acquired the serial lock) is allowed to modify this state (but
  463. must of course be careful to not surprise the current method group's
  464. implementation with such modifications).
  465. 4.3.2 Lock acquisition order
  466. ----------------------------
  467. To prevent deadlocks, locks acquisition must happen in a globally
  468. agreed-upon order. Note that this applies to other forms of blocking
  469. too, but does not necessarily apply to lock acquisitions that do not
  470. block (e.g., trylock() calls that do not get retried forever). Note
  471. that serial transactions are never return back to active transactions
  472. until the transaction has committed. Likewise, active transactions stay
  473. active until they have committed. Per-method-group locks are typically
  474. also not released before commit.
  475. Lock acquisition / blocking rules:
  476. * Transactions must become active or serial before they are allowed
  477. to use method-group-specific locks or blocking (i.e., the serial
  478. lock must be acquired before those other locks, either in serial or
  479. nonserial mode).
  480. * Any number of threads that do not currently run active transactions
  481. can block while trying to get the serial lock in exclusive mode.
  482. Note that active transactions must not block when trying to upgrade
  483. to serial mode unless there is no other transaction that is trying
  484. that (the latter is ensured by the serial lock implementation.
  485. * Method groups must prevent deadlocks on their locks. In
  486. particular, they must also be prepared for another active
  487. transaction that has acquired method-group-specific locks but is
  488. blocked during an attempt to upgrade to being a serial transaction.
  489. See below for details.
  490. * Serial transactions can acquire method-group-specific locks because
  491. there will be no other active nor serial transaction.
  492. There is no single rule for per-method-group blocking because this
  493. depends on when a TM method might acquire locks. If no active
  494. transaction can upgrade to being a serial transaction after it has
  495. acquired per-method-group locks (e.g., when those locks are only
  496. acquired during an attempt to commit), then the TM method does not need
  497. to consider a potential deadlock due to serial mode.
  498. If there can be upgrades to serial mode after the acquisition of
  499. per-method-group locks, then TM methods need to avoid those deadlocks:
  500. * When upgrading to a serial transaction, after acquiring exclusive
  501. rights to the serial lock but before waiting for concurrent active
  502. transactions to finish (*note Serial lock implementation:
  503. serial-lock-impl. for details), we have to wake up all active
  504. transactions waiting on the upgrader's per-method-group locks.
  505. * Active transactions blocking on per-method-group locks need to
  506. check the serial lock and abort if there is a pending serial
  507. transaction.
  508. * Lost wake-ups have to be prevented (e.g., by changing a bit in each
  509. per-method-group lock before doing the wake-up, and only blocking
  510. on this lock using a futex if this bit is not group).
  511. *TODO*: Can reuse serial lock for gl-*? And if we can, does it make
  512. sense to introduce further complexity in the serial lock? For gl-*, we
  513. can really only avoid an abort if we do -wb and -vbv.
  514. 4.3.3 Serial lock implementation
  515. --------------------------------
  516. The serial lock implementation is optimized towards assuming that serial
  517. transactions are infrequent and not the common case. However, the
  518. performance of entering serial mode can matter because when only few
  519. transactions are run concurrently or if there are few threads, then it
  520. can be efficient to run transactions serially.
  521. The serial lock is similar to a multi-reader-single-writer lock in
  522. that there can be several active transactions but only one serial
  523. transaction. However, we do want to avoid contention (in the lock
  524. implementation) between active transactions, so we split up the reader
  525. side of the lock into per-transaction flags that are true iff the
  526. transaction is active. The exclusive writer side remains a shared
  527. single flag, which is acquired using a CAS, for example. On the
  528. fast-path, the serial lock then works similar to Dekker's algorithm but
  529. with several reader flags that a serial transaction would have to check.
  530. A serial transaction thus requires a list of all threads with
  531. potentially active transactions; we can use the serial lock itself to
  532. protect this list (i.e., only threads that have acquired the serial lock
  533. can modify this list).
  534. We want starvation-freedom for the serial lock to allow for using it
  535. to ensure progress for potentially starved transactions (*note Progress
  536. Guarantees: progress-guarantees. for details). However, this is
  537. currently not enforced by the implementation of the serial lock.
  538. Here is pseudo-code for the read/write fast paths of acquiring the
  539. serial lock (read-to-write upgrade is similar to write_lock:
  540. // read_lock:
  541. tx->shared_state |= active;
  542. __sync_synchronize(); // or STLD membar, or C++0x seq-cst fence
  543. while (!serial_lock.exclusive)
  544. if (spinning_for_too_long) goto slowpath;
  545. // write_lock:
  546. if (CAS(&serial_lock.exclusive, 0, this) != 0)
  547. goto slowpath; // writer-writer contention
  548. // need a membar here, but CAS already has full membar semantics
  549. bool need_blocking = false;
  550. for (t: all txns)
  551. {
  552. for (;t->shared_state & active;)
  553. if (spinning_for_too_long) { need_blocking = true; break; }
  554. }
  555. if (need_blocking) goto slowpath;
  556. Releasing a lock in this spin-lock version then just consists of
  557. resetting 'tx->shared_state' to inactive or clearing
  558. 'serial_lock.exclusive'.
  559. However, we can't rely on a pure spinlock because we need to get the
  560. OS involved at some time (e.g., when there are more threads than CPUs to
  561. run on). Therefore, the real implementation falls back to a blocking
  562. slow path, either based on pthread mutexes or Linux futexes.
  563. 4.3.4 Reentrancy
  564. ----------------
  565. libitm has to consider the following cases of reentrancy:
  566. * Transaction calls unsafe code that starts a new transaction: The
  567. outer transaction will become a serial transaction before executing
  568. unsafe code. Therefore, nesting within serial transactions must
  569. work, even if the nested transaction is called from within
  570. uninstrumented code.
  571. * Transaction calls either a transactional wrapper or safe code,
  572. which in turn starts a new transaction: It is not yet defined in
  573. the specification whether this is allowed. Thus, it is undefined
  574. whether libitm supports this.
  575. * Code that starts new transactions might be called from within any
  576. part of libitm: This kind of reentrancy would likely be rather
  577. complex and can probably be avoided. Therefore, it is not
  578. supported.
  579. 4.3.5 Privatization safety
  580. --------------------------
  581. Privatization safety is ensured by libitm using a quiescence-based
  582. approach. Basically, a privatizing transaction waits until all
  583. concurrent active transactions will either have finished (are not active
  584. anymore) or operate on a sufficiently recent snapshot to not access the
  585. privatized data anymore. This happens after the privatizing transaction
  586. has stopped being an active transaction, so waiting for quiescence does
  587. not contribute to deadlocks.
  588. In method groups that need to ensure publication safety explicitly,
  589. active transactions maintain a flag or timestamp in the public/shared
  590. part of the transaction descriptor. Before blocking, privatizers need
  591. to let the other transactions know that they should wake up the
  592. privatizer.
  593. *TODO* Ho to implement the waiters? Should those flags be
  594. per-transaction or at a central place? We want to avoid one wake/wait
  595. call per active transactions, so we might want to use either a tree or
  596. combining to reduce the syscall overhead, or rather spin for a long
  597. amount of time instead of doing blocking. Also, it would be good if
  598. only the last transaction that the privatizer waits for would do the
  599. wake-up.
  600. 4.3.6 Progress guarantees
  601. -------------------------
  602. Transactions that do not make progress when using the current TM method
  603. will eventually try to execute in serial mode. Thus, the serial lock's
  604. progress guarantees determine the progress guarantees of the whole TM.
  605. Obviously, we at least need deadlock-freedom for the serial lock, but it
  606. would also be good to provide starvation-freedom (informally, all
  607. threads will finish executing a transaction eventually iff they get
  608. enough cycles).
  609. However, the scheduling of transactions (e.g., thread scheduling by
  610. the OS) also affects the handling of progress guarantees by the TM.
  611. First, the TM can only guarantee deadlock-freedom if threads do not get
  612. stopped. Likewise, low-priority threads can starve if they do not get
  613. scheduled when other high-priority threads get those cycles instead.
  614. If all threads get scheduled eventually, correct lock implementations
  615. will provide deadlock-freedom, but might not provide starvation-freedom.
  616. We can either enforce the latter in the TM's lock implementation, or
  617. assume that the scheduling is sufficiently random to yield a
  618. probabilistic guarantee that no thread will starve (because eventually,
  619. a transaction will encounter a scheduling that will allow it to run).
  620. This can indeed work well in practice but is not necessarily guaranteed
  621. to work (e.g., simple spin locks can be pretty efficient).
  622. Because enforcing stronger progress guarantees in the TM has a higher
  623. runtime overhead, we focus on deadlock-freedom right now and assume that
  624. the threads will get scheduled eventually by the OS (but don't consider
  625. threads with different priorities). We should support
  626. starvation-freedom for serial transactions in the future. Everything
  627. beyond that is highly related to proper contention management across all
  628. of the TM (including with TM method to choose), and is future work.
  629. *TODO* Handling thread priorities: We want to avoid priority
  630. inversion but it's unclear how often that actually matters in practice.
  631. Workloads that have threads with different priorities will likely also
  632. require lower latency or higher throughput for high-priority threads.
  633. Therefore, it probably makes not that much sense (except for eventual
  634. progress guarantees) to use priority inheritance until the TM has
  635. priority-aware contention management.
  636. 
  637. File: libitm.info, Node: GNU Free Documentation License, Next: Library Index, Prev: Internals, Up: Top
  638. GNU Free Documentation License
  639. ******************************
  640. Version 1.3, 3 November 2008
  641. Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
  642. <http://fsf.org/>
  643. Everyone is permitted to copy and distribute verbatim copies
  644. of this license document, but changing it is not allowed.
  645. 0. PREAMBLE
  646. The purpose of this License is to make a manual, textbook, or other
  647. functional and useful document "free" in the sense of freedom: to
  648. assure everyone the effective freedom to copy and redistribute it,
  649. with or without modifying it, either commercially or
  650. noncommercially. Secondarily, this License preserves for the
  651. author and publisher a way to get credit for their work, while not
  652. being considered responsible for modifications made by others.
  653. This License is a kind of "copyleft", which means that derivative
  654. works of the document must themselves be free in the same sense.
  655. It complements the GNU General Public License, which is a copyleft
  656. license designed for free software.
  657. We have designed this License in order to use it for manuals for
  658. free software, because free software needs free documentation: a
  659. free program should come with manuals providing the same freedoms
  660. that the software does. But this License is not limited to
  661. software manuals; it can be used for any textual work, regardless
  662. of subject matter or whether it is published as a printed book. We
  663. recommend this License principally for works whose purpose is
  664. instruction or reference.
  665. 1. APPLICABILITY AND DEFINITIONS
  666. This License applies to any manual or other work, in any medium,
  667. that contains a notice placed by the copyright holder saying it can
  668. be distributed under the terms of this License. Such a notice
  669. grants a world-wide, royalty-free license, unlimited in duration,
  670. to use that work under the conditions stated herein. The
  671. "Document", below, refers to any such manual or work. Any member
  672. of the public is a licensee, and is addressed as "you". You accept
  673. the license if you copy, modify or distribute the work in a way
  674. requiring permission under copyright law.
  675. A "Modified Version" of the Document means any work containing the
  676. Document or a portion of it, either copied verbatim, or with
  677. modifications and/or translated into another language.
  678. A "Secondary Section" is a named appendix or a front-matter section
  679. of the Document that deals exclusively with the relationship of the
  680. publishers or authors of the Document to the Document's overall
  681. subject (or to related matters) and contains nothing that could
  682. fall directly within that overall subject. (Thus, if the Document
  683. is in part a textbook of mathematics, a Secondary Section may not
  684. explain any mathematics.) The relationship could be a matter of
  685. historical connection with the subject or with related matters, or
  686. of legal, commercial, philosophical, ethical or political position
  687. regarding them.
  688. The "Invariant Sections" are certain Secondary Sections whose
  689. titles are designated, as being those of Invariant Sections, in the
  690. notice that says that the Document is released under this License.
  691. If a section does not fit the above definition of Secondary then it
  692. is not allowed to be designated as Invariant. The Document may
  693. contain zero Invariant Sections. If the Document does not identify
  694. any Invariant Sections then there are none.
  695. The "Cover Texts" are certain short passages of text that are
  696. listed, as Front-Cover Texts or Back-Cover Texts, in the notice
  697. that says that the Document is released under this License. A
  698. Front-Cover Text may be at most 5 words, and a Back-Cover Text may
  699. be at most 25 words.
  700. A "Transparent" copy of the Document means a machine-readable copy,
  701. represented in a format whose specification is available to the
  702. general public, that is suitable for revising the document
  703. straightforwardly with generic text editors or (for images composed
  704. of pixels) generic paint programs or (for drawings) some widely
  705. available drawing editor, and that is suitable for input to text
  706. formatters or for automatic translation to a variety of formats
  707. suitable for input to text formatters. A copy made in an otherwise
  708. Transparent file format whose markup, or absence of markup, has
  709. been arranged to thwart or discourage subsequent modification by
  710. readers is not Transparent. An image format is not Transparent if
  711. used for any substantial amount of text. A copy that is not
  712. "Transparent" is called "Opaque".
  713. Examples of suitable formats for Transparent copies include plain
  714. ASCII without markup, Texinfo input format, LaTeX input format,
  715. SGML or XML using a publicly available DTD, and standard-conforming
  716. simple HTML, PostScript or PDF designed for human modification.
  717. Examples of transparent image formats include PNG, XCF and JPG.
  718. Opaque formats include proprietary formats that can be read and
  719. edited only by proprietary word processors, SGML or XML for which
  720. the DTD and/or processing tools are not generally available, and
  721. the machine-generated HTML, PostScript or PDF produced by some word
  722. processors for output purposes only.
  723. The "Title Page" means, for a printed book, the title page itself,
  724. plus such following pages as are needed to hold, legibly, the
  725. material this License requires to appear in the title page. For
  726. works in formats which do not have any title page as such, "Title
  727. Page" means the text near the most prominent appearance of the
  728. work's title, preceding the beginning of the body of the text.
  729. The "publisher" means any person or entity that distributes copies
  730. of the Document to the public.
  731. A section "Entitled XYZ" means a named subunit of the Document
  732. whose title either is precisely XYZ or contains XYZ in parentheses
  733. following text that translates XYZ in another language. (Here XYZ
  734. stands for a specific section name mentioned below, such as
  735. "Acknowledgements", "Dedications", "Endorsements", or "History".)
  736. To "Preserve the Title" of such a section when you modify the
  737. Document means that it remains a section "Entitled XYZ" according
  738. to this definition.
  739. The Document may include Warranty Disclaimers next to the notice
  740. which states that this License applies to the Document. These
  741. Warranty Disclaimers are considered to be included by reference in
  742. this License, but only as regards disclaiming warranties: any other
  743. implication that these Warranty Disclaimers may have is void and
  744. has no effect on the meaning of this License.
  745. 2. VERBATIM COPYING
  746. You may copy and distribute the Document in any medium, either
  747. commercially or noncommercially, provided that this License, the
  748. copyright notices, and the license notice saying this License
  749. applies to the Document are reproduced in all copies, and that you
  750. add no other conditions whatsoever to those of this License. You
  751. may not use technical measures to obstruct or control the reading
  752. or further copying of the copies you make or distribute. However,
  753. you may accept compensation in exchange for copies. If you
  754. distribute a large enough number of copies you must also follow the
  755. conditions in section 3.
  756. You may also lend copies, under the same conditions stated above,
  757. and you may publicly display copies.
  758. 3. COPYING IN QUANTITY
  759. If you publish printed copies (or copies in media that commonly
  760. have printed covers) of the Document, numbering more than 100, and
  761. the Document's license notice requires Cover Texts, you must
  762. enclose the copies in covers that carry, clearly and legibly, all
  763. these Cover Texts: Front-Cover Texts on the front cover, and
  764. Back-Cover Texts on the back cover. Both covers must also clearly
  765. and legibly identify you as the publisher of these copies. The
  766. front cover must present the full title with all words of the title
  767. equally prominent and visible. You may add other material on the
  768. covers in addition. Copying with changes limited to the covers, as
  769. long as they preserve the title of the Document and satisfy these
  770. conditions, can be treated as verbatim copying in other respects.
  771. If the required texts for either cover are too voluminous to fit
  772. legibly, you should put the first ones listed (as many as fit
  773. reasonably) on the actual cover, and continue the rest onto
  774. adjacent pages.
  775. If you publish or distribute Opaque copies of the Document
  776. numbering more than 100, you must either include a machine-readable
  777. Transparent copy along with each Opaque copy, or state in or with
  778. each Opaque copy a computer-network location from which the general
  779. network-using public has access to download using public-standard
  780. network protocols a complete Transparent copy of the Document, free
  781. of added material. If you use the latter option, you must take
  782. reasonably prudent steps, when you begin distribution of Opaque
  783. copies in quantity, to ensure that this Transparent copy will
  784. remain thus accessible at the stated location until at least one
  785. year after the last time you distribute an Opaque copy (directly or
  786. through your agents or retailers) of that edition to the public.
  787. It is requested, but not required, that you contact the authors of
  788. the Document well before redistributing any large number of copies,
  789. to give them a chance to provide you with an updated version of the
  790. Document.
  791. 4. MODIFICATIONS
  792. You may copy and distribute a Modified Version of the Document
  793. under the conditions of sections 2 and 3 above, provided that you
  794. release the Modified Version under precisely this License, with the
  795. Modified Version filling the role of the Document, thus licensing
  796. distribution and modification of the Modified Version to whoever
  797. possesses a copy of it. In addition, you must do these things in
  798. the Modified Version:
  799. A. Use in the Title Page (and on the covers, if any) a title
  800. distinct from that of the Document, and from those of previous
  801. versions (which should, if there were any, be listed in the
  802. History section of the Document). You may use the same title
  803. as a previous version if the original publisher of that
  804. version gives permission.
  805. B. List on the Title Page, as authors, one or more persons or
  806. entities responsible for authorship of the modifications in
  807. the Modified Version, together with at least five of the
  808. principal authors of the Document (all of its principal
  809. authors, if it has fewer than five), unless they release you
  810. from this requirement.
  811. C. State on the Title page the name of the publisher of the
  812. Modified Version, as the publisher.
  813. D. Preserve all the copyright notices of the Document.
  814. E. Add an appropriate copyright notice for your modifications
  815. adjacent to the other copyright notices.
  816. F. Include, immediately after the copyright notices, a license
  817. notice giving the public permission to use the Modified
  818. Version under the terms of this License, in the form shown in
  819. the Addendum below.
  820. G. Preserve in that license notice the full lists of Invariant
  821. Sections and required Cover Texts given in the Document's
  822. license notice.
  823. H. Include an unaltered copy of this License.
  824. I. Preserve the section Entitled "History", Preserve its Title,
  825. and add to it an item stating at least the title, year, new
  826. authors, and publisher of the Modified Version as given on the
  827. Title Page. If there is no section Entitled "History" in the
  828. Document, create one stating the title, year, authors, and
  829. publisher of the Document as given on its Title Page, then add
  830. an item describing the Modified Version as stated in the
  831. previous sentence.
  832. J. Preserve the network location, if any, given in the Document
  833. for public access to a Transparent copy of the Document, and
  834. likewise the network locations given in the Document for
  835. previous versions it was based on. These may be placed in the
  836. "History" section. You may omit a network location for a work
  837. that was published at least four years before the Document
  838. itself, or if the original publisher of the version it refers
  839. to gives permission.
  840. K. For any section Entitled "Acknowledgements" or "Dedications",
  841. Preserve the Title of the section, and preserve in the section
  842. all the substance and tone of each of the contributor
  843. acknowledgements and/or dedications given therein.
  844. L. Preserve all the Invariant Sections of the Document, unaltered
  845. in their text and in their titles. Section numbers or the
  846. equivalent are not considered part of the section titles.
  847. M. Delete any section Entitled "Endorsements". Such a section
  848. may not be included in the Modified Version.
  849. N. Do not retitle any existing section to be Entitled
  850. "Endorsements" or to conflict in title with any Invariant
  851. Section.
  852. O. Preserve any Warranty Disclaimers.
  853. If the Modified Version includes new front-matter sections or
  854. appendices that qualify as Secondary Sections and contain no
  855. material copied from the Document, you may at your option designate
  856. some or all of these sections as invariant. To do this, add their
  857. titles to the list of Invariant Sections in the Modified Version's
  858. license notice. These titles must be distinct from any other
  859. section titles.
  860. You may add a section Entitled "Endorsements", provided it contains
  861. nothing but endorsements of your Modified Version by various
  862. parties--for example, statements of peer review or that the text
  863. has been approved by an organization as the authoritative
  864. definition of a standard.
  865. You may add a passage of up to five words as a Front-Cover Text,
  866. and a passage of up to 25 words as a Back-Cover Text, to the end of
  867. the list of Cover Texts in the Modified Version. Only one passage
  868. of Front-Cover Text and one of Back-Cover Text may be added by (or
  869. through arrangements made by) any one entity. If the Document
  870. already includes a cover text for the same cover, previously added
  871. by you or by arrangement made by the same entity you are acting on
  872. behalf of, you may not add another; but you may replace the old
  873. one, on explicit permission from the previous publisher that added
  874. the old one.
  875. The author(s) and publisher(s) of the Document do not by this
  876. License give permission to use their names for publicity for or to
  877. assert or imply endorsement of any Modified Version.
  878. 5. COMBINING DOCUMENTS
  879. You may combine the Document with other documents released under
  880. this License, under the terms defined in section 4 above for
  881. modified versions, provided that you include in the combination all
  882. of the Invariant Sections of all of the original documents,
  883. unmodified, and list them all as Invariant Sections of your
  884. combined work in its license notice, and that you preserve all
  885. their Warranty Disclaimers.
  886. The combined work need only contain one copy of this License, and
  887. multiple identical Invariant Sections may be replaced with a single
  888. copy. If there are multiple Invariant Sections with the same name
  889. but different contents, make the title of each such section unique
  890. by adding at the end of it, in parentheses, the name of the
  891. original author or publisher of that section if known, or else a
  892. unique number. Make the same adjustment to the section titles in
  893. the list of Invariant Sections in the license notice of the
  894. combined work.
  895. In the combination, you must combine any sections Entitled
  896. "History" in the various original documents, forming one section
  897. Entitled "History"; likewise combine any sections Entitled
  898. "Acknowledgements", and any sections Entitled "Dedications". You
  899. must delete all sections Entitled "Endorsements."
  900. 6. COLLECTIONS OF DOCUMENTS
  901. You may make a collection consisting of the Document and other
  902. documents released under this License, and replace the individual
  903. copies of this License in the various documents with a single copy
  904. that is included in the collection, provided that you follow the
  905. rules of this License for verbatim copying of each of the documents
  906. in all other respects.
  907. You may extract a single document from such a collection, and
  908. distribute it individually under this License, provided you insert
  909. a copy of this License into the extracted document, and follow this
  910. License in all other respects regarding verbatim copying of that
  911. document.
  912. 7. AGGREGATION WITH INDEPENDENT WORKS
  913. A compilation of the Document or its derivatives with other
  914. separate and independent documents or works, in or on a volume of a
  915. storage or distribution medium, is called an "aggregate" if the
  916. copyright resulting from the compilation is not used to limit the
  917. legal rights of the compilation's users beyond what the individual
  918. works permit. When the Document is included in an aggregate, this
  919. License does not apply to the other works in the aggregate which
  920. are not themselves derivative works of the Document.
  921. If the Cover Text requirement of section 3 is applicable to these
  922. copies of the Document, then if the Document is less than one half
  923. of the entire aggregate, the Document's Cover Texts may be placed
  924. on covers that bracket the Document within the aggregate, or the
  925. electronic equivalent of covers if the Document is in electronic
  926. form. Otherwise they must appear on printed covers that bracket
  927. the whole aggregate.
  928. 8. TRANSLATION
  929. Translation is considered a kind of modification, so you may
  930. distribute translations of the Document under the terms of section
  931. 4. Replacing Invariant Sections with translations requires special
  932. permission from their copyright holders, but you may include
  933. translations of some or all Invariant Sections in addition to the
  934. original versions of these Invariant Sections. You may include a
  935. translation of this License, and all the license notices in the
  936. Document, and any Warranty Disclaimers, provided that you also
  937. include the original English version of this License and the
  938. original versions of those notices and disclaimers. In case of a
  939. disagreement between the translation and the original version of
  940. this License or a notice or disclaimer, the original version will
  941. prevail.
  942. If a section in the Document is Entitled "Acknowledgements",
  943. "Dedications", or "History", the requirement (section 4) to
  944. Preserve its Title (section 1) will typically require changing the
  945. actual title.
  946. 9. TERMINATION
  947. You may not copy, modify, sublicense, or distribute the Document
  948. except as expressly provided under this License. Any attempt
  949. otherwise to copy, modify, sublicense, or distribute it is void,
  950. and will automatically terminate your rights under this License.
  951. However, if you cease all violation of this License, then your
  952. license from a particular copyright holder is reinstated (a)
  953. provisionally, unless and until the copyright holder explicitly and
  954. finally terminates your license, and (b) permanently, if the
  955. copyright holder fails to notify you of the violation by some
  956. reasonable means prior to 60 days after the cessation.
  957. Moreover, your license from a particular copyright holder is
  958. reinstated permanently if the copyright holder notifies you of the
  959. violation by some reasonable means, this is the first time you have
  960. received notice of violation of this License (for any work) from
  961. that copyright holder, and you cure the violation prior to 30 days
  962. after your receipt of the notice.
  963. Termination of your rights under this section does not terminate
  964. the licenses of parties who have received copies or rights from you
  965. under this License. If your rights have been terminated and not
  966. permanently reinstated, receipt of a copy of some or all of the
  967. same material does not give you any rights to use it.
  968. 10. FUTURE REVISIONS OF THIS LICENSE
  969. The Free Software Foundation may publish new, revised versions of
  970. the GNU Free Documentation License from time to time. Such new
  971. versions will be similar in spirit to the present version, but may
  972. differ in detail to address new problems or concerns. See
  973. <http://www.gnu.org/copyleft/>.
  974. Each version of the License is given a distinguishing version
  975. number. If the Document specifies that a particular numbered
  976. version of this License "or any later version" applies to it, you
  977. have the option of following the terms and conditions either of
  978. that specified version or of any later version that has been
  979. published (not as a draft) by the Free Software Foundation. If the
  980. Document does not specify a version number of this License, you may
  981. choose any version ever published (not as a draft) by the Free
  982. Software Foundation. If the Document specifies that a proxy can
  983. decide which future versions of this License can be used, that
  984. proxy's public statement of acceptance of a version permanently
  985. authorizes you to choose that version for the Document.
  986. 11. RELICENSING
  987. "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
  988. World Wide Web server that publishes copyrightable works and also
  989. provides prominent facilities for anybody to edit those works. A
  990. public wiki that anybody can edit is an example of such a server.
  991. A "Massive Multiauthor Collaboration" (or "MMC") contained in the
  992. site means any set of copyrightable works thus published on the MMC
  993. site.
  994. "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
  995. license published by Creative Commons Corporation, a not-for-profit
  996. corporation with a principal place of business in San Francisco,
  997. California, as well as future copyleft versions of that license
  998. published by that same organization.
  999. "Incorporate" means to publish or republish a Document, in whole or
  1000. in part, as part of another Document.
  1001. An MMC is "eligible for relicensing" if it is licensed under this
  1002. License, and if all works that were first published under this
  1003. License somewhere other than this MMC, and subsequently
  1004. incorporated in whole or in part into the MMC, (1) had no cover
  1005. texts or invariant sections, and (2) were thus incorporated prior
  1006. to November 1, 2008.
  1007. The operator of an MMC Site may republish an MMC contained in the
  1008. site under CC-BY-SA on the same site at any time before August 1,
  1009. 2009, provided the MMC is eligible for relicensing.
  1010. ADDENDUM: How to use this License for your documents
  1011. ====================================================
  1012. To use this License in a document you have written, include a copy of
  1013. the License in the document and put the following copyright and license
  1014. notices just after the title page:
  1015. Copyright (C) YEAR YOUR NAME.
  1016. Permission is granted to copy, distribute and/or modify this document
  1017. under the terms of the GNU Free Documentation License, Version 1.3
  1018. or any later version published by the Free Software Foundation;
  1019. with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
  1020. Texts. A copy of the license is included in the section entitled ``GNU
  1021. Free Documentation License''.
  1022. If you have Invariant Sections, Front-Cover Texts and Back-Cover
  1023. Texts, replace the "with...Texts." line with this:
  1024. with the Invariant Sections being LIST THEIR TITLES, with
  1025. the Front-Cover Texts being LIST, and with the Back-Cover Texts
  1026. being LIST.
  1027. If you have Invariant Sections without Cover Texts, or some other
  1028. combination of the three, merge those two alternatives to suit the
  1029. situation.
  1030. If your document contains nontrivial examples of program code, we
  1031. recommend releasing these examples in parallel under your choice of free
  1032. software license, such as the GNU General Public License, to permit
  1033. their use in free software.
  1034. 
  1035. File: libitm.info, Node: Library Index, Prev: GNU Free Documentation License, Up: Top
  1036. Library Index
  1037. *************
  1038. �[index�]
  1039. * Menu:
  1040. * FDL, GNU Free Documentation License: GNU Free Documentation License.
  1041. (line 6)
  1042. * Introduction: Top. (line 6)
  1043. 
  1044. Tag Table:
  1045. Node: Top1141
  1046. Node: Enabling libitm2045
  1047. Node: C/C++ Language Constructs for TM2440
  1048. Node: The libitm ABI3923
  1049. Ref: txn-code-properties7721
  1050. Node: Internals18814
  1051. Ref: serial-lock-impl28852
  1052. Ref: progress-guarantees33613
  1053. Node: GNU Free Documentation License35891
  1054. Node: Library Index61021
  1055. 
  1056. End Tag Table