The stmx Reference Manual

This is the stmx Reference Manual, version 2.0.5, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon May 15 06:31:51 2023 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 stmx

Composable Transactional Memory

Author

Massimiliano Ghilardi

License

LLGPL

Version

2.0.5

Dependencies
  • alexandria (system).
  • log4cl (system).
  • closer-mop (system).
  • bordeaux-threads (system).
  • trivial-garbage (system).
Source

stmx.asd.

Child Components

3 Modules

Modules are listed depth-first from the system components tree.


3.1 stmx/asm

Source

stmx.asd.

Parent Component

stmx (system).

Child Components

3.2 stmx/lang

Dependency

asm (module).

Source

stmx.asd.

Parent Component

stmx (system).

Child Components

3.3 stmx/main

Dependency

lang (module).

Source

stmx.asd.

Parent Component

stmx (system).

Child Components

3.4 stmx/util

Dependencies
Source

stmx.asd.

Parent Component

stmx (system).

Child Components

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


4.1 Lisp


4.1.1 stmx/stmx.asd

Source

stmx.asd.

Parent Component

stmx (system).

ASDF Systems

stmx.


4.1.2 stmx/asm/package.lisp

Source

stmx.asd.

Parent Component

asm (module).

Packages

stmx.asm.


4.1.3 stmx/asm/compiler.lisp

Dependency

package.lisp (file).

Source

stmx.asd.

Parent Component

asm (module).

Public Interface
Internals

4.1.4 stmx/asm/x86-32,64-known.lisp

Dependency

compiler.lisp (file).

Source

stmx.asd.

Parent Component

asm (module).


4.1.5 stmx/asm/x86-32,64-insts.lisp

Dependency

x86-32,64-known.lisp (file).

Source

stmx.asd.

Parent Component

asm (module).


4.1.6 stmx/asm/x86-32,64-vops.lisp

Dependency

x86-32,64-insts.lisp (file).

Source

stmx.asd.

Parent Component

asm (module).

Public Interface

+transaction-started+ (constant).


4.1.7 stmx/asm/cpuid.lisp

Dependency

x86-32,64-vops.lisp (file).

Source

stmx.asd.

Parent Component

asm (module).

Public Interface

4.1.8 stmx/asm/transaction.lisp

Dependency

x86-32,64-vops.lisp (file).

Source

stmx.asd.

Parent Component

asm (module).

Public Interface
Internals

transaction-abort-macro (macro).


4.1.9 stmx/lang/package.lisp

Source

stmx.asd.

Parent Component

lang (module).

Packages

stmx.lang.


4.1.10 stmx/lang/macro.lisp

Dependency

package.lisp (file).

Source

stmx.asd.

Parent Component

lang (module).

Public Interface
Internals

4.1.11 stmx/lang/features.lisp

Dependency

macro.lisp (file).

Source

stmx.asd.

Parent Component

lang (module).

Public Interface
Internals

4.1.12 stmx/lang/features-reader.lisp

Dependency

features.lisp (file).

Source

stmx.asd.

Parent Component

lang (module).

Public Interface

enable-#?-syntax (macro).

Internals

4.1.13 stmx/lang/thread.lisp

Dependency

features-reader.lisp (file).

Source

stmx.asd.

Parent Component

lang (module).

Public Interface
Internals

4.1.14 stmx/lang/features-detect.lisp

Dependency

thread.lisp (file).

Source

stmx.asd.

Parent Component

lang (module).

Public Interface

4.1.15 stmx/lang/hw-transactions.lisp

Dependency

features-detect.lisp (file).

Source

stmx.asd.

Parent Component

lang (module).

Public Interface

4.1.16 stmx/lang/atomic-ops.lisp

Dependency

features-detect.lisp (file).

Source

stmx.asd.

Parent Component

lang (module).

Public Interface
Internals

4.1.17 stmx/lang/mutex.lisp

Dependency

atomic-ops.lisp (file).

Source

stmx.asd.

Parent Component

lang (module).

Public Interface
Internals

4.1.18 stmx/lang/atomic-counter.lisp

Dependencies
Source

stmx.asd.

Parent Component

lang (module).

Public Interface
Internals

4.1.19 stmx/lang/cons.lisp

Dependency

thread.lisp (file).

Source

stmx.asd.

Parent Component

lang (module).

Public Interface
Internals

*cons-pool* (special variable).


4.1.20 stmx/lang/fast-vector.lisp

Dependency

macro.lisp (file).

Source

stmx.asd.

Parent Component

lang (module).

Public Interface
Internals

4.1.21 stmx/lang/hash-table.lisp

Dependency

cons.lisp (file).

Source

stmx.asd.

Parent Component

lang (module).

Public Interface
Internals

incf-hash-counter (macro).


4.1.22 stmx/lang/print.lisp

Dependency

macro.lisp (file).

Source

stmx.asd.

Parent Component

lang (module).

Public Interface
Internals

4.1.23 stmx/lang/class-precedence-list.lisp

Dependency

macro.lisp (file).

Source

stmx.asd.

Parent Component

lang (module).

Public Interface

clos-compute-class-precedence-list (function).

Internals

4.1.24 stmx/main/package.lisp

Source

stmx.asd.

Parent Component

main (module).

Packages

stmx.


4.1.25 stmx/main/version.lisp

Dependency

package.lisp (file).

Source

stmx.asd.

Parent Component

main (module).

Public Interface

*stmx-version* (special variable).

Internals

4.1.26 stmx/main/global-clock.lisp

Dependency

package.lisp (file).

Source

stmx.asd.

Parent Component

main (module).

Public Interface

make-load-form (method).

Internals

4.1.27 stmx/main/tvar-fwd.lisp

Dependency

global-clock.lisp (file).

Source

stmx.asd.

Parent Component

main (module).

Public Interface
Internals

4.1.28 stmx/main/classes.lisp

Dependency

tvar-fwd.lisp (file).

Source

stmx.asd.

Parent Component

main (module).

Public Interface
Internals

4.1.29 stmx/main/txhash.lisp

Dependency

classes.lisp (file).

Source

stmx.asd.

Parent Component

main (module).

Public Interface

print-object (method).

Internals

4.1.30 stmx/main/tlog.lisp

Dependency

txhash.lisp (file).

Source

stmx.asd.

Parent Component

main (module).

Public Interface

print-object (method).

Internals

4.1.31 stmx/main/tvar.lisp

Dependency

tlog.lisp (file).

Source

stmx.asd.

Parent Component

main (module).

Public Interface
Internals

4.1.32 stmx/main/optimize-for.lisp

Dependency

tvar.lisp (file).

Source

stmx.asd.

Parent Component

main (module).

Public Interface
Internals

4.1.33 stmx/main/tvar-slot.lisp

Dependency

optimize-for.lisp (file).

Source

stmx.asd.

Parent Component

main (module).

Public Interface
Internals

4.1.34 stmx/main/tstruct.lisp

Dependency

tvar-slot.lisp (file).

Source

stmx.asd.

Parent Component

main (module).

Public Interface
Internals

4.1.35 stmx/main/tclass.lisp

Dependencies
Source

stmx.asd.

Parent Component

main (module).

Public Interface
Internals

4.1.36 stmx/main/tslot.lisp

Dependency

tclass.lisp (file).

Source

stmx.asd.

Parent Component

main (module).

Public Interface
Internals

4.1.37 stmx/main/hw-atomic.lisp

Dependency

classes.lisp (file).

Source

stmx.asd.

Parent Component

main (module).

Public Interface

hw-atomic2 (macro).

Internals

4.1.38 stmx/main/commit.lisp

Dependencies
Source

stmx.asd.

Parent Component

main (module).

Public Interface
Internals

4.1.39 stmx/main/sw-atomic.lisp

Dependency

commit.lisp (file).

Source

stmx.asd.

Parent Component

main (module).

Public Interface

transaction (macro).

Internals

4.1.40 stmx/main/atomic.lisp

Dependencies
Source

stmx.asd.

Parent Component

main (module).

Public Interface
Internals

hw-transaction-test (function).


4.1.41 stmx/main/orelse.lisp

Dependency

atomic.lisp (file).

Source

stmx.asd.

Parent Component

main (module).

Public Interface
Internals

4.1.42 stmx/util/package.lisp

Source

stmx.asd.

Parent Component

util (module).

Packages

stmx.util.


4.1.43 stmx/util/misc.lisp

Dependency

package.lisp (file).

Source

stmx.asd.

Parent Component

util (module).

Public Interface
Internals

4.1.44 stmx/util/print.lisp

Dependency

package.lisp (file).

Source

stmx.asd.

Parent Component

util (module).

Internals

print-object-contents (generic function).


4.1.45 stmx/util/container.lisp

Dependency

misc.lisp (file).

Source

stmx.asd.

Parent Component

util (module).

Public Interface

4.1.46 stmx/util/tcons.lisp

Dependency

misc.lisp (file).

Source

stmx.asd.

Parent Component

util (module).

Public Interface
Internals

4.1.47 stmx/util/tcons-list.lisp

Dependency

tcons.lisp (file).

Source

stmx.asd.

Parent Component

util (module).

Public Interface
Internals

4.1.48 stmx/util/tcons-alist.lisp

Dependency

tcons.lisp (file).

Source

stmx.asd.

Parent Component

util (module).

Public Interface
Internals

4.1.49 stmx/util/tcons-set.lisp

Dependency

tcons.lisp (file).

Source

stmx.asd.

Parent Component

util (module).


4.1.50 stmx/util/tcons-tree.lisp

Dependency

tcons.lisp (file).

Source

stmx.asd.

Parent Component

util (module).

Public Interface
Internals

copy-ttree (function).


4.1.51 stmx/util/tcons-higher.lisp

Dependency

tcons-alist.lisp (file).

Source

stmx.asd.

Parent Component

util (module).


4.1.52 stmx/util/tvar.lisp

Dependency

container.lisp (file).

Source

stmx.asd.

Parent Component

util (module).

Public Interface

4.1.53 stmx/util/tcell.lisp

Dependency

container.lisp (file).

Source

stmx.asd.

Parent Component

util (module).

Public Interface
Internals

+empty-tcell+ (constant).


4.1.54 stmx/util/tstack.lisp

Dependency

container.lisp (file).

Source

stmx.asd.

Parent Component

util (module).

Public Interface
Internals

4.1.55 stmx/util/tfifo.lisp

Dependencies
Source

stmx.asd.

Parent Component

util (module).

Public Interface
Internals

4.1.56 stmx/util/tchannel.lisp

Dependencies
Source

stmx.asd.

Parent Component

util (module).

Public Interface
Internals

4.1.57 stmx/util/bheap.lisp

Dependency

container.lisp (file).

Source

stmx.asd.

Parent Component

util (module).

Public Interface
Internals

4.1.58 stmx/util/gmap.lisp

Dependencies
Source

stmx.asd.

Parent Component

util (module).

Public Interface
Internals

4.1.59 stmx/util/rbmap.lisp

Dependency

gmap.lisp (file).

Source

stmx.asd.

Parent Component

util (module).

Public Interface

rbmap (class).

Internals

4.1.60 stmx/util/tmap.lisp

Dependency

rbmap.lisp (file).

Source

stmx.asd.

Parent Component

util (module).

Public Interface
Internals

4.1.61 stmx/util/simple-tvector.lisp

Dependency

print.lisp (file).

Source

stmx.asd.

Parent Component

util (module).

Public Interface
Internals

4.1.62 stmx/util/ghash-table.lisp

Dependency

print.lisp (file).

Source

stmx.asd.

Parent Component

util (module).

Public Interface
Internals

4.1.63 stmx/util/thash-table.lisp

Dependencies
Source

stmx.asd.

Parent Component

util (module).

Public Interface
Internals

5 Packages

Packages are listed by definition order.


5.1 stmx.asm

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

5.2 stmx.lang

Source

package.lisp.

Use List
  • bordeaux-threads.
  • common-lisp.
Used By List
Public Interface
Internals

5.3 stmx

Source

package.lisp.

Use List
  • bordeaux-threads.
  • closer-mop.
  • common-lisp.
  • stmx.lang.
Used By List

stmx.util.

Public Interface
Internals

5.4 stmx.util

Source

package.lisp.

Use List
Public Interface
Internals

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


6.1 Public Interface


6.1.1 Constants

Constant: +hw-transaction-started+
Package

stmx.lang.

Source

hw-transactions.lisp.

Constant: +hw-transaction-supported+
Package

stmx.lang.

Source

hw-transactions.lisp.

Constant: +impl-package+

Designator for the SBCL internal package where we look for VOP-related symbols

Package

stmx.asm.

Source

compiler.lisp.

Constant: +transaction-started+

Value returned by (transaction-begin) if the transaction is successfully started. It is an implementation-dependent fixnum, different from all possible transactions abort error codes.

Package

stmx.asm.

Source

x86-32,64-vops.lisp.

Constant: +transaction-user-abort+

Value returned by (transaction-begin) if the transaction was manually aborted by calling (transaction-abort).
It is an implementation-dependent fixnum, different from +transaction-started+ and from all error codes indicating a spontaneous abort.

Package

stmx.asm.

Source

transaction.lisp.

Constant: +unbound-tvar+

Unbound TVARs actually contain this value. Use with care.

Package

stmx.

Source

tvar-fwd.lisp.


6.1.2 Special variables

Special Variable: *current-thread*
Package

stmx.lang.

Source

thread.lisp.

Special Variable: *stmx-version*
Package

stmx.

Source

version.lisp.


6.1.3 Macros

Macro: after-commit (&body body)

Register BODY to be invoked after the current transaction commits.
If BODY signals an error when executed, the error is propagated
to the caller and further code registered with AFTER-COMMIT is not executed, but the transaction remains committed.

WARNING: Code registered with after-commit has a number or restrictions:

1) if BODY signal an error when executed, the error is propagated to the caller, forms registered later with AFTER-COMMIT are not executed,
but the transaction remains committed.

2) BODY is *not* executed inside a transaction: while it is certainly possible to explicitly run an (atomic) block from it, doing so would probably defeat the purpose of AFTER-COMMIT and it may also cause a significant performance penalty.

Package

stmx.

Source

commit.lisp.

Macro: aif (test then &optional else)
Package

stmx.lang.

Source

macro.lisp.

Macro: analyze-struct ((defstruct name-and-options &rest slot-descriptions))

Analyze the slots of a non-transactional struct, so that transactional structs can subclass it. Use this macro to wrap a DEFSTRUCT as follows:
(ANALYZE-STRUCT (DEFSTRUCT {struct-name | (struct-name [options])} slots-description*)

Note: this macro only analyzes the structure definition, does *not* define the structure. See NON-TRANSACTIONAL-STRUCT for that.

Package

stmx.

Source

tstruct.lisp.

Macro: atomic (&rest body)

Main entry point for STMX.

Run BODY in a memory transaction. All changes to transactional memory will be visible to other threads only after BODY returns normally (commits). If BODY signals an error, its effects on transactional memory are rolled back and the error is propagated normally.
Also, no work-in-progress transactional memory will ever be visible to other threads.

A memory transaction can also retry: in such case ATOMIC will abort it, wait until some of the value read by the transaction have changed,
then re-run the transaction from the beginning.

Since STMX transactions do not lock memory, it is possible for different transactions to try to update the same memory (almost) simultaneously.
In such case, the conflict is detected when they try to commit or rollback, and only one conflicting transaction is allowed to commit:
all others are immediately re-run again from the beginning.

For this reason, a transaction SHOULD NOT perform any irreversible operation such as INPUT/OUTPUT: the result would be that I/O is executed multiple times, or executed even when it shouldn’t have!
Irreversible operations SHOULD be performed OUTSIDE transactions,
for example by queueing them into transactional memory that another thread will consume and then, OUTSIDE transactions, actually perform them.

For how to create transactional memory, see TRANSACTIONAL or TVAR.
For another way to run transactions, see also TRANSACTION.
For advanced features inside transactions, see RETRY, ORELSE, NONBLOCKING, BEFORE-COMMIT and AFTER-COMMIT.

For pre-defined transactional classes, see the package STMX.UTIL

Package

stmx.

Source

atomic.lisp.

Macro: atomic-compare-and-swap (place old new)
Package

stmx.lang.

Source

atomic-ops.lisp.

Macro: atomic-decf (place &optional delta)

Atomically decrement PLACE by DELTA. Return _previous_ value of PLACE.

Package

stmx.lang.

Source

atomic-ops.lisp.

Macro: atomic-incf (place &optional delta)

Atomically increment PLACE by DELTA. Return _previous_ value of PLACE.

Package

stmx.lang.

Source

atomic-ops.lisp.

Macro: atomic-pop (place)

Like POP, but atomic. PLACE may be read multiple times before the operation completes – the write does not occur until such time that no other thread modified PLACE between the read and the write.

Works only on places supported by ATOMIC-COMPARE-AND-SWAP.

Package

stmx.lang.

Source

atomic-ops.lisp.

Macro: awhen (test &body body)
Package

stmx.lang.

Source

macro.lisp.

Macro: before-commit (&body body)

Register BODY to be invoked immediately before the current transaction commits. If BODY signals an error when executed, the error is propagated to the caller, further code registered with BEFORE-COMMIT are not executed,
and the transaction rollbacks.

BODY can read and write normally to transactional memory, and in case of conflicts the whole transaction (not only the code registered with before-commit)
is re-executed from the beginning.

WARNING: BODY cannot (retry) - attempts to do so will signal an error. Starting a nested transaction and retrying inside that is acceptable,
as long as the (retry) does not propagate outside BODY.

Package

stmx.

Source

commit.lisp.

Macro: define-constant-once (name value &optional doc)

Same as DEFCONSTANT, but evaluate VALUE only once:
re-executing again the same (DEFINE-CONSTANT-ONCE name ...) has no effects.

Package

stmx.lang.

Source

features-detect.lisp.

Macro: define-global (name value &optional doc)

Define NAME as a global variable, declaring that it will have the same value in all threads, i.e. it will not be special nor dynamically bound.

This is implemented either with a compiler-specific macro (for example SB-EXT:DEFGLOBAL on SBCL), or as DEFVAR if no better implementation is available.

Package

stmx.lang.

Source

features-detect.lisp.

Macro: defprint-object ((obj class &key type identity) &rest body)
Package

stmx.lang.

Source

print.lisp.

Macro: do-fast-vector ((element) fast-vector &body body)
Package

stmx.lang.

Source

fast-vector.lisp.

Macro: do-ghash ((key &optional value index) hash &body body)

Execute BODY on each KEY/VALUE contained in HASH. Return NIL.

Package

stmx.util.

Source

ghash-table.lisp.

Macro: do-gmap ((key &optional value &key from-end) m &body body)

Execute BODY in order on each key/value pair contained in M:
first execute it on the smallest key, then the second smallest... finally execute BODY on the largest key. Return nil.

If :FROM-END is true, BODY will be executed first on the largest key, then on the second largest key... and finally on the smallest key.

Adding or removing keys from M during this call (even from other threads) has undefined consequences. Not even the current key can be removed.

Package

stmx.util.

Source

gmap.lisp.

Macro: do-hash ((key &optional value) hash &body body)

Execute body on each key/value pair contained in hash table

Package

stmx.lang.

Source

hash-table.lisp.

Macro: do-simple-tvector ((element) tvec &body body)

Execute BODY on each ELEMENT contained in simple-tvector TVEC.

Creates an implicit block named NIL, so (return ...) can be used to exit early from the loop with an explicit return value.

Package

stmx.util.

Source

simple-tvector.lisp.

Macro: do-tree ((atom tree &optional result) &body body)

Execute BODY for each atom inside TREE

Package

stmx.lang.

Source

macro.lisp.

Macro: enable-#?-syntax ()
Package

stmx.lang.

Source

features-reader.lisp.

Macro: eval-always (&body body)
Package

stmx.lang.

Source

macro.lisp.

Macro: fast-atomic (&rest body)

Possibly slightly faster variant of ATOMIC.

On systems supporting hardware transactions (as of July 2013, very few systems support them), FAST-ATOMIC and ATOMIC are identical.
On other systems, multiple nested FAST-ATOMIC forms may be slightly faster than multiple nested ATOMIC blocks, at the price of compiling BODY more than once.

Package

stmx.

Source

atomic.lisp.

Macro: fast-vector-pop-macro (fast-vector &optional default)

If FAST-VECTOR is not empty, remove its last element and return it and t as multiple values. Otherwise evaluate DEFAULT and return (values DEFAULT NIL).

Package

stmx.lang.

Source

fast-vector.lisp.

Macro: get-atomic-place (place &optional place-mutex)

Return current value of atomic PLACE.

Package

stmx.lang.

Source

atomic-counter.lisp.

Macro: get-atomic-place-plus-delta (place delta &optional place-mutex)

Return DELTA plus current value of atomic PLACE.

Package

stmx.lang.

Source

atomic-counter.lisp.

Macro: hw-atomic2 ((&key hw-write-version err test-for-running-tx? update-stat) &optional body fallback)

Run BODY in a hardware memory transaction. All changes to transactional memory will be visible to other threads only after BODY returns normally (commits). If BODY signals an error, its effects on transactional memory are rolled back and the error is propagated normally.
Also, no work-in-progress transactional memory will ever be visible to other threads.

If hardware memory transaction aborts for a conflict, rerun it.
If it fails for some other reason, execute FALLBACK.

Package

stmx.

Source

hw-atomic.lisp.

Macro: hw-transaction-abort ()

Abort a hardware memory transaction currently in progress. Causes a rollback of *all* transaction effects, execution resumes at (hw-transaction-begin) by returning abort reason.

Package

stmx.lang.

Source

hw-transactions.lisp.

Macro: hw-transaction-begin ()

Start a hardware memory transaction. Return +hw-transaction-started+ if transaction started successfully, otherwise return abort reason.

Package

stmx.lang.

Source

hw-transactions.lisp.

Macro: hw-transaction-end ()

Try to commit a hardware memory transaction currently in progress. If commit is successful, return normally. Otherwise execution resumes at (hw-transaction-begin) by returning abort reason.

Package

stmx.lang.

Source

hw-transactions.lisp.

Macro: hw-transaction-rerun-may-succeed? (err-code)

If ERR-CODE is the result returned by (HW-TRANSACTION-BEGIN) of an *aborted* transaction, return T if re-running the same transaction has a possibility to succeed,
i.e. if the abort reason was temporary (as for example a conflict with another thread). Return NIL if re-running the same transaction has no possibility to succeed.

Package

stmx.lang.

Source

hw-transactions.lisp.

Macro: hw-transaction-running? ()

Return T if a hardware memory transaction is in progress.

Package

stmx.lang.

Source

hw-transactions.lisp.

Macro: hw-transaction-supported-and-running? ()
Package

stmx.lang.

Source

hw-transactions.lisp.

Macro: hw-transaction-supported? ()

Return T if the CPU supports hardware memory transactions, and there is a compiler extension to use them, otherwise return NIL.

Package

stmx.lang.

Source

hw-transactions.lisp.

Macro: if-bind (var test then &optional else)
Package

stmx.lang.

Source

macro.lisp.

Macro: incf-atomic-place (place &optional delta place-mutex)

Increase atomic PLACE by DELTA and return its new value.

Package

stmx.lang.

Source

atomic-counter.lisp.

Macro: let1 (var value &body body)
Package

stmx.lang.

Source

macro.lisp.

Macro: log.debug (&rest args)
Package

stmx.lang.

Source

macro.lisp.

Macro: log.make-logger (&rest args)
Package

stmx.lang.

Source

macro.lisp.

Macro: log.trace (&rest args)
Package

stmx.lang.

Source

macro.lisp.

Macro: mem-read-barrier (&body before)

Memory read barrier. Execute BEFORE, then put the barrier.

Package

stmx.lang.

Source

atomic-ops.lisp.

Macro: mem-write-barrier (&body before)

Memory write barrier. Execute BEFORE, then put the barrier.

Package

stmx.lang.

Source

atomic-ops.lisp.

Macro: new (class &rest initargs &key &allow-other-keys)
Package

stmx.lang.

Source

macro.lisp.

Macro: non-transactional-struct ((defstruct name-and-options &rest slot-descriptions))

Use this macro to wrap a normal DEFSTRUCT as follows:
(NON-TRANSACTIONAL-STRUCT (DEFSTRUCT {struct-name | (struct-name [options])} slots-description*)

The effect is the same as DEFSTRUCT, plus its slots will be analyzed
so that transactional structs can subclass it

Package

stmx.

Source

tstruct.lisp.

Macro: nonblocking (&body body)

Execute all the forms in BODY in a single nested transaction and:
a) in case of transaction conflicts, re-execute BODY
b) if BODY returns normally, commit and return multiple values:
T followed by the values returned by BODY.
b) if BODY signals an error, rollback and raise such error.
d) if BODY attempts to retry, immediately return NIL without waiting/sleeping.

Can only be used inside an ATOMIC block.

Package

stmx.

Source

orelse.lisp.

Macro: optimize-for-transaction ((defun-or-defmethod name (&rest args) &body body))
Package

stmx.

Source

optimize-for.lisp.

Macro: optimize-for-transaction* ((&key inline body-hwtx body-swtx body-notx) (defun-or-defmethod name (&rest args) &body body))
Package

stmx.

Source

optimize-for.lisp.

Macro: orelse (&body body)

Execute each form in BODY from left to right in separate, nested transactions until one succeeds (i.e. commits) or signals an error.

If a form calls (RETRY) or has a temporary failure (temporary failures as for example conflicts are normally invisible because (ATOMIC ...) re-executes them automatically) advance to the next form and run it instead of retrying the current one.

Returns the value of the transaction that succeeded,
or signals the error raised by the transaction that failed.

Can only be used inside an ATOMIC block.

Package

stmx.

Source

orelse.lisp.

Macro: pop-free-cons^ (place)

Equivalent to POP, but also assumes the CONS at PLACE is no longer used and can be added to free CONS pool.
Removes and returns the first element in PLACE.

Package

stmx.lang.

Source

cons.lisp.

Macro: push^ (value place)

Equivalent to PUSH, but uses CONS pool to speedup allocation. Inserts VALUE as the first element in PLACE.
Return the modified PLACE.

Package

stmx.lang.

Source

cons.lisp.

Macro: save-thread-initial-bindings (&rest syms)
Package

stmx.lang.

Source

thread.lisp.

Macro: set-atomic-place (place value &optional place-mutex)

Set and return value of atomic PLACE.

Package

stmx.lang.

Source

atomic-counter.lisp.

Macro: tpop (place)

Equivalent to POP, but for TCONS transactional cells. Removes and returns the first element in PLACE.

Package

stmx.util.

Source

tcons.lisp.

Macro: tpush (value place)

Equivalent to PUSH, but for TCONS transactional cells. Inserts VALUE as the first element in PLACE. Return the modified PLACE.

Package

stmx.util.

Source

tcons.lisp.

Macro: transaction ((defun-or-defmethod func-name args &body body))

Deprecated. Use ATOMIC instead.

Define FUNC-NAME as a new atomic function or method.
Use this macro to wrap a normal DEFUN or DEFMETHOD as follows: (TRANSACTION (DEFUN function-name (arguments) body))
or
(TRANSACTION (DEFMETHOD function-name (arguments) body))

The effect is the same as DEFUN - or DEFMETHOD - plus:
- the BODY is wrapped inside (atomic ...)

Package

stmx.

Source

sw-atomic.lisp.

Macro: transactional ((defclass-or-defstruct class-or-struct-name &rest direct-superclasses-slots-and-options))

Define CLASS-OR-STRUCT-NAME as a new transactional class or struct.

Use this macro to wrap a normal DEFCLASS as follows: (TRANSACTIONAL (DEFCLASS class-name (superclasses) (slots) [options]))

Or to wrap a normal DEFCLASS as follows:
(TRANSACTIONAL (DEFSTRUCT (class-name (options)) slots))

Package

stmx.

Source

tclass.lisp.

Macro: transactional-class ((defclass class-name direct-superclasses direct-slots &rest class-options))

Define CLASS-NAME as a new transactional class.
Use this macro to wrap a normal DEFCLASS as follows:
(TRANSACTIONAL (DEFCLASS class-name (superclasses) (slots) [options]))

The effect is the same as DEFCLASS, plus:
- by default, slots are transactional memory (implemented by TVARs)
- it inherits also from TRANSACTIONAL-OBJECT
- the metaclass is TRANSACTIONAL-CLASS
- it internally defines a method INITIALIZE-INSTANCE :before, do NOT redefine it

Package

stmx.

Source

tclass.lisp.

Macro: transactional-struct ((defstruct name-and-options &rest slot-descriptions))

Define NAME as a new transactional struct.
Use this macro to wrap a normal DEFSTRUCT as follows:
(TRANSACTIONAL-STRUCT (DEFSTRUCT {struct-name | (struct-name [options])} slots-description*)

The effect is the same as DEFSTRUCT, plus:
- by default, direct slots are transactional memory (implemented by TVARs)

Package

stmx.

Source

tstruct.lisp.

Macro: when-bind (var test &body body)
Package

stmx.lang.

Source

macro.lisp.

Macro: with-gensym (name &body body)
Package

stmx.lang.

Source

macro.lisp.

Macro: with-gensyms ((&rest names) &body body)
Package

stmx.lang.

Source

macro.lisp.

Macro: with-lock ((lock) &body body)

Faster replacement for BORDEAUX-THREADS:WITH-LOCK-HELD.

Package

stmx.lang.

Source

mutex.lisp.


6.1.4 Compiler macros

Compiler Macro: tlast (list &optional n)
Package

stmx.util.

Source

tcons-list.lisp.

Compiler Macro: tlist (&rest list)
Package

stmx.util.

Source

tcons.lisp.

Compiler Macro: tlist* (arg0 &rest args)
Package

stmx.util.

Source

tcons.lisp.


6.1.5 Setf expanders

Setf Expander: (setf $) (var)
Package

stmx.

Source

tvar.lisp.

Reader

$ (function).

Writer

set-$ (function).

Setf Expander: (setf $-slot) (var)
Package

stmx.

Source

tvar-slot.lisp.

Reader

$-slot (function).

Setf Expander: (setf get-ghash) (hash key)
Package

stmx.util.

Source

ghash-table.lisp.

Reader

get-ghash (function).

Writer

set-ghash (function).

Setf Expander: (setf tcar) (cons)

Set VALUE as the first element in a TCONS or non-null TLIST. This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons.lisp.

Reader

tcar (function).

Setf Expander: (setf tcdr) (cons)

Set VALUE as the rest element in a TCONS or non-null TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons.lisp.

Reader

tcdr (function).

Setf Expander: (setf tfirst) (cons)

Set VALUE as the first element in a TCONS or non-null TLIST.

This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons.lisp.

Reader

tfirst (function).

Setf Expander: (setf trest) (cons)

Set VALUE as the rest element in a TCONS or non-null TLIST.

This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons.lisp.

Reader

trest (function).

Setf Expander: (setf tsvref) (tvec index)
Package

stmx.util.

Source

simple-tvector.lisp.

Reader

tsvref (function).

Writer

set-tsvref (function).


6.1.6 Ordinary functions

Function: $ (var)

Get the value from the transactional variable VAR and return it. Return +unbound-tvar+ if VAR is not bound to a value.

Works both inside and outside transactions.
During transactions, it uses transaction log to record the read and to check for any value stored in the log.

Package

stmx.

Source

tvar.lisp.

Setf expander for this function

(setf $).

Function: $-slot (var)

Get the value from the transactional variable VAR and return it. Signal an error if VAR is not bound to a value.

Works both inside and outside transactions.
During transactions, it uses transaction log to record the read and to check for any value stored in the log.

Package

stmx.

Source

tvar-slot.lisp.

Setf expander for this function

(setf $-slot).

Function: add-to-gmap (m &rest keys-and-values)

N-ary version of SET-GMAP and (SETF (GET-GMAP ...) ...): Given a list of alternating keys and values,
add or replace each of them into M. Return M.

Package

stmx.util.

Source

gmap.lisp.

Function: all-features (&rest list)

Return T if all features from LIST are present in *FEATURE-LIST* and have non-NIL value.

Package

stmx.lang.

Source

features.lisp.

Function: assoc-feature (f)

Return (list F VALUE) if F is present in *FEATURE-LIST*

Package

stmx.lang.

Source

features.lisp.

Function: bound-$? (var)

Return true if transactional variable VAR is bound to a value. Works both outside and inside transactions.

During transactions, it uses transaction log to record the read and to check for any value stored in the log.

Package

stmx.

Source

tvar-slot.lisp.

Function: call-after-commit (func &optional log)

Register FUNC function to be invoked after the current transaction commits.

IMPORTANT: See AFTER-COMMIT for what FUNC must not do.

Package

stmx.

Source

commit.lisp.

Function: call-before-commit (func &optional log)

Register FUNC function to be invoked immediately before the current transaction commits.

IMPORTANT: See BEFORE-COMMIT for what FUNC must not do.

Package

stmx.

Source

commit.lisp.

Function: clear-ghash (hash)

Remove all keys and values from HASH. Return HASH.

Package

stmx.util.

Source

ghash-table.lisp.

Function: clear-gmap (m)

Remove all keys and values from M. Return M.

Package

stmx.util.

Source

gmap.lisp.

Function: clear-hash (hash)

Same as (clrhash hash).

Package

stmx.lang.

Source

hash-table.lisp.

Function: clos-compute-class-precedence-list (class-name direct-superclasses-names)
Package

stmx.lang.

Source

class-precedence-list.lisp.

Function: compile-if (flag)
Package

stmx.asm.

Source

compiler.lisp.

Function: compile-if-package (package-name)
Package

stmx.asm.

Source

compiler.lisp.

Function: compile-if-symbol (package-name symbol-name)
Package

stmx.asm.

Source

compiler.lisp.

Function: concat-symbols (&rest things)

Print the things to a string, the convert the string into a symbol interned in current package. Return the symbol

Package

stmx.lang.

Source

macro.lisp.

Function: cons^ (&optional a b)

Get a CONS from free cons pool, otherwise allocate it. Return the CONS.

Package

stmx.lang.

Source

cons.lisp.

Function: copy-gmap (m)

Create and return a copy of binary tree M. Keys and values in M are shallow copied.

Package

stmx.util.

Source

gmap.lisp.

Function: copy-gmap-into (mcopy m)

Fill MCOPY with a copy of gmap M and return MCOPY. Copies all keys and values from M into MCOPY
and removes any other key/value already present in MCOPY.

Package

stmx.util.

Source

gmap.lisp.

Function: copy-hash-table (dst src)

Copy all key/value pairs from hash-table SRC into hash-table DST. Other keys (and their values) present in DST but not in SRC are not modified. Return DST.

Package

stmx.lang.

Source

hash-table.lisp.

Function: copy-talist (talist)

Return a new association list which is EQUAL to TALIST.

Package

stmx.util.

Source

tcons-alist.lisp.

Function: cpuid (eax &optional ecx)
Package

stmx.asm.

Source

cpuid.lisp.

Function: default-feature (f &optional value)

Add feature F and its VALUE into *FEATURE-LIST*, unless F is already present. Return (values T VALUE) if F was actually inserted in *FEATURE-LIST*, otherwise return NIL and the value already present in *FEATURE-LIST*.

Package

stmx.lang.

Source

features.lisp.

Function: default-features (&rest alist)

Set the value of each feature in ALIST, unless the feature is already present in *FEATURE-LIST*. Each element in ALIST must be either
a pair (FEATURE VALUE) or a simple atom FEATURE.
In the latter case, the FEATURE value will default to T.

Package

stmx.lang.

Source

features.lisp.

Function: ensure-thread-initial-binding (sym form)
Package

stmx.lang.

Source

thread.lisp.

Function: ensure-thread-initial-bindings (&rest syms-and-forms)
Package

stmx.lang.

Source

thread.lisp.

Function: fast-vector-capacity (fast-vector)

Return current capacity of FAST-VECTOR.

Package

stmx.lang.

Source

fast-vector.lisp.

Function: fast-vector-clear (fast-vector)

Remove all elements from FAST-VECTOR. Return FAST-VECTOR.

Package

stmx.lang.

Source

fast-vector.lisp.

Function: fast-vector-length (fast-vector)

Return current length of FAST-VECTOR.

Package

stmx.lang.

Source

fast-vector.lisp.

Function: fast-vector-pop (fast-vector &optional default)

If FAST-VECTOR is not empty, remove its last element and return it and t as multiple values. Otherwise return (values DEFAULT NIL).

Package

stmx.lang.

Source

fast-vector.lisp.

Function: fast-vector-push (new-element fast-vector)

If FAST-VECTOR is not full, append NEW-ELEMENT to FAST-VECTOR and return the index of the pushed element.
Otherwise return NIL.

Package

stmx.lang.

Source

fast-vector.lisp.

Function: fast-vector-push-extend (new-element fast-vector)

If FAST-VECTOR is full, resize it. Then append NEW-ELEMENT to FAST-VECTOR and return the index of the pushed element.

Package

stmx.lang.

Source

fast-vector.lisp.

Function: find-symbol* (symbol-name &optional package-name)

Find and return the symbol named SYMBOL-NAME in PACKAGE

Package

stmx.asm.

Source

compiler.lisp.

Function: fixnum/= (x y)

Optimized version of (/= x y) for FIXNUM arguments

Package

stmx.util.

Source

misc.lisp.

Function: fixnum< (x y)

Optimized version of (< x y) for FIXNUM arguments

Package

stmx.util.

Source

misc.lisp.

Function: fixnum= (x y)

Optimized version of (= x y) for FIXNUM arguments

Package

stmx.util.

Source

misc.lisp.

Function: fixnum> (x y)

Optimized version of (> x y) for FIXNUM arguments

Package

stmx.util.

Source

misc.lisp.

Function: free-cons^ (cell)

Add a CONS cell to free cons pool.

Package

stmx.lang.

Source

cons.lisp.

Function: free-list^ (list)

Add a list of CONS cells to free cons pool.

Package

stmx.lang.

Source

cons.lisp.

Function: get-atomic-counter (counter)

Return current value of atomic COUNTER.

Package

stmx.lang.

Source

atomic-counter.lisp.

Function: get-atomic-counter-plus-delta (counter delta)

Return DELTA plus current value of atomic COUNTER.

Package

stmx.lang.

Source

atomic-counter.lisp.

Function: get-feature (f &optional default)

Return value of F in *FEATURE-LIST* and T, or (values DEFAULT NIL) if not present or has NIL value.

Package

stmx.lang.

Source

features.lisp.

Function: get-ghash (hash key &optional default)

If KEY is associated to VALUE in HASH, return (values VALUE t) Otherwise return (values DEFAULT nil).

Package

stmx.util.

Source

ghash-table.lisp.

Setf expander for this function

(setf get-ghash).

Function: get-gmap (m key &optional default)

Find KEY in binary tree M and return its value and T as multiple values. If M does not contain KEY, return (values DEFAULT NIL).

Package

stmx.util.

Source

gmap.lisp.

Function: (setf get-gmap) (m key)

Add KEY to binary tree M if not present, and associate VALUE to KEY in M. Return VALUE.

Package

stmx.util.

Source

gmap.lisp.

Function: get-hash (hash key)

Same as (gethash key hash), only with reversed arguments.

Package

stmx.lang.

Source

hash-table.lisp.

Function: (setf get-hash) (hash key)

Same as (setf (gethash key hash) value), only with reversed key and hash arguments.

Package

stmx.lang.

Source

hash-table.lisp.

Function: ghash-keys (src &optional to-list)

Return a list containing the keys in ghash-table SRC.
If TO-LIST is not nil, it will be appended to the returned list. TO-LIST contents is not destructively modified.

Package

stmx.util.

Source

ghash-table.lisp.

Function: ghash-pairs (src &optional to-alist)

Return an alist containing a (key . value) pair for each entry in ghash-table SRC.
If TO-ALIST is not nil, it will be appended to the returned alist. TO-ALIST contents is not destructively modified.

Package

stmx.util.

Source

ghash-table.lisp.

Function: ghash-table-count (hash)

Return the number of KEY/VALUE entries in ghash-table HASH.

Package

stmx.util.

Source

ghash-table.lisp.

Function: ghash-table-empty? (hash)

Return T if GHASH-TABLE is empty, i.e. if it contains no entries.

Package

stmx.util.

Source

ghash-table.lisp.

Function: ghash-table-hash (hash)

Return the symbol used by ghash-table HASH to hash keys.

Package

stmx.util.

Source

ghash-table.lisp.

Function: ghash-table-test (hash)

Return the symbol used by ghash-table HASH to compare keys.

Package

stmx.util.

Source

ghash-table.lisp.

Function: ghash-values (src &optional to-list)

Return a list containing the values in ghash-table SRC.
If TO-LIST is not nil, it will be appended to the returned list. TO-LIST contents is not destructively modified.

Package

stmx.util.

Source

ghash-table.lisp.

Function: gmap-count (m)

Return number of elements in binary tree M.

Package

stmx.util.

Source

gmap.lisp.

Function: gmap-empty? (m)

Return t if binary tree M is empty, otherwise return nil.

Package

stmx.util.

Source

gmap.lisp.

Function: gmap-keys (m &optional to-list)

Return an ordered list of all keys contained in M.

Package

stmx.util.

Source

gmap.lisp.

Function: gmap-pairs (m &optional to-alist)

Return an ordered list of pairs (key . value) containing all entries in M.

Package

stmx.util.

Source

gmap.lisp.

Function: gmap-pred (m)

Return the predicate symbol used by binary tree M to sort keys.

Package

stmx.util.

Source

gmap.lisp.

Function: gmap-values (m &optional to-list)

Return a list of all values contained in M.
The values are returned in the order given by their keys: first the value associated to the smallest key, and so on.

Package

stmx.util.

Source

gmap.lisp.

Function: hash-table-keys (src &optional to-list)

Return a list containing the keys in hash-table SRC.
If TO-LIST is not nil, it will be appended to the returned list. TO-LIST contents is not destructively modified.

Package

stmx.lang.

Source

hash-table.lisp.

Function: hash-table-pairs (src &optional to-alist)

Return an alist containing a (key . value) pair for each entry in hash-table SRC.
If TO-ALIST is not nil, it will be appended to the returned alist. TO-ALIST contents is not destructively modified.

Package

stmx.lang.

Source

hash-table.lisp.

Function: hash-table-values (src &optional to-list)

Return a list containing the values in hash-table SRC.
If TO-LIST is not nil, it will be appended to the returned list. TO-LIST contents is not destructively modified.

Package

stmx.lang.

Source

hash-table.lisp.

Function: incf-atomic-counter (counter &optional delta)

Increase atomic COUNTER by DELTA and return its new value.

Package

stmx.lang.

Source

atomic-counter.lisp.

Function: lock-elision-supported-p ()

Test for HLE, i.e. hardware lock elision.
HLE is supported if (cpuid 7) returns ebx with bit 4 set. If a processor does not support HLE, it will ignore the assembler instruction prefixes XACQUIRE and XRELEASE.

Package

stmx.asm.

Source

cpuid.lisp.

Function: make-atomic-counter ()

Create and return a new ATOMIC-COUNTER.

Package

stmx.lang.

Source

atomic-counter.lisp.

Function: make-fast-vector (initial-capacity &key element-type initial-element)

Create and return an initially empty FAST-VECTOR with specified maximum length.

Note: initial-element MUST be compatible with type element-type,
i.e. (typep initial-element element-type) must return true.

Package

stmx.lang.

Source

fast-vector.lisp.

Function: make-mutex ()

Create and return a MUTEX.

Package

stmx.lang.

Source

mutex.lisp.

Function: make-tlist (size &key initial-element)

Constructs a tlist with SIZE elements each set to INITIAL-ELEMENT

Package

stmx.util.

Source

tcons.lisp.

Function: map-ghash (hash func)

Invoke FUNC on each key/value pair contained in HASH. Return NIL.
FUNC must be a function accepting two arguments: key and value.

Adding or removing keys from HASH during this call (even from other threads) has undefined consequences. Not even the current key can be removed.

Package

stmx.util.

Source

ghash-table.lisp.

Function: map-gmap (m func)

Invoke FUNC in order on each key/value pair contained in M:
first invoke it on the smallest key, then the second smallest... finally invoke FUNC on the largest key. Return nil.

FUNC must be a function accepting two arguments: key and value.

Adding or removing keys from M during this call (even from other threads) has undefined consequences. Not even the current key can be removed.

Package

stmx.util.

Source

gmap.lisp.

Function: max-gmap (m)

Return the largest key in M, its value, and t as multiple values, or (values nil nil nil) if M is empty

Package

stmx.util.

Source

gmap.lisp.

Function: merge-hash-tables (dst src)

Copy hash-table SRC into hash-table DST.

Return t if SRC and DST are compatible,
i.e. if they contain eq values for the keys common to both, otherwise return nil.
(in the latter case, the merge will not be completed).

Package

stmx.lang.

Source

hash-table.lisp.

Function: min-gmap (m)

Return the smallest key in M, its value, and t as multiple values, or (values nil nil nil) if M is empty.

Package

stmx.util.

Source

gmap.lisp.

Function: mutex-is-free? (mutex)

Return T if MUTEX is free. Return NIL if MUTEX
is currently locked by current thread or some other thread.

Package

stmx.lang.

Source

mutex.lisp.

Function: mutex-is-own-or-free? (mutex)

Return T if MUTEX is free or locked by current thread. Return NIL if MUTEX is currently locked by some other thread.

Package

stmx.lang.

Source

mutex.lisp.

Function: mutex-is-own? (mutex)

Return T if MUTEX is locked by current thread.

Package

stmx.lang.

Source

mutex.lisp.

Reader: mutex-owner (instance)
Writer: (setf mutex-owner) (instance)
Package

stmx.lang.

Source

mutex.lisp.

Target Slot

mutex-owner.

Function: release-mutex (mutex)

Release MUTEX. Return NIL. Consequences are undefined if MUTEX is locked by another thread or is already unlocked.

Package

stmx.lang.

Source

mutex.lisp.

Function: rem-ghash (hash key)

Remove KEY from HASH.
Return T if KEY was present in HASH, otherwise return NIL.

Package

stmx.util.

Source

ghash-table.lisp.

Function: rem-gmap (m key)

Find and remove KEY and its associated value from binary tree M. Return t if KEY was removed, nil if not found.

Package

stmx.util.

Source

gmap.lisp.

Function: rem-hash (hash key)

Same as (remhash key hash), only with reversed arguments.

Package

stmx.lang.

Source

hash-table.lisp.

Function: remove-from-gmap (m &rest keys)

N-ary version of REM-GMAP:
remove a list of keys from M. Return M.

Package

stmx.util.

Source

gmap.lisp.

Function: retry ()

Abort the current transaction and re-run it again from the beginning.

Before re-executing, the transaction will wait on all variables that it read until at least one of them changes.

Package

stmx.

Source

classes.lisp.

Function: run-atomic (tx)

Function equivalent of the ATOMIC macro.

Run the function TX inside a memory transaction.
If the transaction is invalid (conflicts) re-run TX immediately, ignoring any error it may signal.

Otherwise, commit if TX returns normally, or rollback if it signals an error.

Finally, if TX called (retry), re-run it after at least some of the transactional memory it read has changed.

Package

stmx.

Source

atomic.lisp.

Function: run-orelse (&rest funcs)

Function variant of ‘orelse’. Execute the functions in FUNCS list
one by one from left to right in separate, nested transactions until one succeeds (i.e. commits) or signals an error.

If a nested transaction is invalid or wants to retry, run the next one.

Returns the value of the transaction that succeeded,
or signals the error raised by the transaction that failed.

Can only be used inside an ATOMIC block.

Package

stmx.

Source

orelse.lisp.

Function: set-atomic-counter (counter value)

Set and return value of atomic COUNTER.

Package

stmx.lang.

Source

atomic-counter.lisp.

Function: set-feature (f &optional value)

Set feature F to VALUE, even if F is already present in *FEATURE-LIST*. Return VALUE.

Package

stmx.lang.

Source

features.lisp.

Function: set-features (&rest plist)

Set the value of each feature in PLIST, even if the feature is already present in *FEATURE-LIST*. Each element in PLIST must be either
a pair (FEATURE VALUE) or a simple atom FEATURE.
In the latter case, the FEATURE value will default to T.

Package

stmx.lang.

Source

features.lisp.

Function: set-ghash (hash key value)

Add KEY to HASH, associating it to VALUE. Return VALUE.

Package

stmx.util.

Source

ghash-table.lisp.

Setf expanders to this function

(setf get-ghash).

Function: set-gmap (m key value)

Add KEY to binary tree M if not present, and associate KEY to VALUE in M. Return VALUE.

Package

stmx.util.

Source

gmap.lisp.

Function: set-hash (hash key value)

Shortcut for (setf (gethash key hash) value)

Package

stmx.lang.

Source

hash-table.lisp.

Function: simple-tvector (length &key element-type initial-element initial-contents)

Create and return a new SIMPLE-TVECTOR.

Package

stmx.util.

Source

simple-tvector.lisp.

Function: simple-tvector-length (tvec)

Return the length of simple-tvector TVEC.

Package

stmx.util.

Source

simple-tvector.lisp.

Function: start-multithreading ()
Package

stmx.lang.

Source

thread.lisp.

Function: start-thread (function &key name initial-bindings)
Package

stmx.lang.

Source

thread.lisp.

Function: stringify (&rest things)

Print the things to a string and return it

Package

stmx.lang.

Source

macro.lisp.

Function: sxhash-equalp (x)

Variant of SXHASH designed for EQUALP tests, i.e.
(equalp x y) implies (= (sxhash-equalp x) (sxhash-equalp y)).
A common use is for ghash-tables and thash-tables that use :test ’equalp

Package

stmx.util.

Source

misc.lisp.

Function: symbol-name* (symbol-name)
Package

stmx.asm.

Source

compiler.lisp.

Function: tacons (key datum talist)

Construct a new talist by adding the pair (KEY . DATUM) to TALIST.

Package

stmx.util.

Source

tcons-alist.lisp.

Function: tassoc (item talist &key key test test-not)

Return the tcons in TALIST whose tcar is equal (by a given test or EQL) to the ITEM.

Package

stmx.util.

Source

tcons-alist.lisp.

Function: tatom (object)

Return NIL if OBJECT is a TCONS, and T otherwise.

Package

stmx.util.

Source

tcons.lisp.

Function: tcaaaar (tlist)

Return the CAR of the CAAAR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcaaaar) (tlist)

Set the CAR of the CAAAR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcaaadr (tlist)

Return the CAR of the CAADR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcaaadr) (tlist)

Set the CAR of the CAADR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcaaar (tlist)

Return the CAR of the CAAR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcaaar) (tlist)

Set the CAR of the CAAR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcaadar (tlist)

Return the CAR of the CADAR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcaadar) (tlist)

Set the CAR of the CADAR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcaaddr (tlist)

Return the CAR of the CADDR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcaaddr) (tlist)

Set the CAR of the CADDR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcaadr (tlist)

Return the CAR of the CADR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcaadr) (tlist)

Set the CAR of the CADR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcaar (tlist)

Return the CAR of the CAR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcaar) (tlist)

Set the CAR of the CAR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcadaar (tlist)

Return the CAR of the CDAAR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcadaar) (tlist)

Set the CAR of the CDAAR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcadadr (tlist)

Return the CAR of the CDADR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcadadr) (tlist)

Set the CAR of the CDADR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcadar (tlist)

Return the CAR of the CDAR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcadar) (tlist)

Set the CAR of the CDAR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcaddar (tlist)

Return the CAR of the CDDAR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcaddar) (tlist)

Set the CAR of the CDDAR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcaddr (tlist)

Return the CAR of the CDDR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcaddr) (tlist)

Set the CAR of the CDDR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcadr (tlist)

Return the CAR of the CDR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcadr) (tlist)

Set the CAR of the CDR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcar (list)

Return the 1st object in a TLIST.

Package

stmx.util.

Source

tcons.lisp.

Setf expander for this function

(setf tcar).

Function: tcdaaar (tlist)

Return the CDR of the CAAAR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcdaaar) (tlist)

Set the CDR of the CAAAR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcdaadr (tlist)

Return the CDR of the CAADR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcdaadr) (tlist)

Set the CDR of the CAADR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcdaar (tlist)

Return the CDR of the CAAR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcdaar) (tlist)

Set the CDR of the CAAR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcdadar (tlist)

Return the CDR of the CADAR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcdadar) (tlist)

Set the CDR of the CADAR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcdaddr (tlist)

Return the CDR of the CADDR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcdaddr) (tlist)

Set the CDR of the CADDR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcdadr (tlist)

Return the CDR of the CADR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcdadr) (tlist)

Set the CDR of the CADR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcdar (tlist)

Return the CDR of the CAR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcdar) (tlist)

Set the CDR of the CAR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcddaar (tlist)

Return the CDR of the CDAAR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcddaar) (tlist)

Set the CDR of the CDAAR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcddadr (tlist)

Return the CDR of the CDADR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcddadr) (tlist)

Set the CDR of the CDADR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcddar (tlist)

Return the CDR of the CDAR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcddar) (tlist)

Set the CDR of the CDAR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcdddar (tlist)

Return the CDR of the CDDAR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcdddar) (tlist)

Set the CDR of the CDDAR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcdddr (tlist)

Return the CDR of the CDDR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcdddr) (tlist)

Set the CDR of the CDDR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcddr (tlist)

Return the CDR of the CDR of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tcddr) (tlist)

Set the CDR of the CDR of a TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tcdr (list)

Return all but the first object in a TLIST.

Package

stmx.util.

Source

tcons.lisp.

Setf expander for this function

(setf tcdr).

Function: tcell (&optional value)

Create and return a new TCELL.

Package

stmx.util.

Source

tcell.lisp.

Function: tcons (first rest)

Create and return a new TCONS.

Package

stmx.util.

Source

tcons.lisp.

Function: tconsp (object)
Package

stmx.util.

Source

tcons.lisp.

Function: teighth (tlist)

Return the 8th object in a TLIST or NIL if there is no 8th object.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf teighth) (tlist)

Set the 8th object in a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tendp (object)

This is the recommended way to test for the end of a proper TLIST. It returns true if OBJECT is NIL, false if OBJECT is a TCONS, and an error for any other type of OBJECT.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tfifo ()
Package

stmx.util.

Source

tfifo.lisp.

Function: tfifth (tlist)

Return the 5th object in a TLIST or NIL if there is no 5th object.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tfifth) (tlist)

Set the 5th object in a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tfirst (tlist)

Return the first element in a TCONS or TLIST.

Package

stmx.util.

Source

tcons.lisp.

Setf expander for this function

(setf tfirst).

Function: tfourth (tlist)

Return the 4th object in a TLIST or NIL if there is no 4th object.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tfourth) (tlist)

Set the 4th object in a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tlast (list &optional n)

Return the last N conses (not the last element!) of a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tlist (&rest list)

Create and return a new TLIST, whose cells are TCONS.

Package

stmx.util.

Source

tcons.lisp.

Function: tlist* (arg0 &rest args)

Return a TLIST of the arguments with last TCONS a dotted pair.

Package

stmx.util.

Source

tcons.lisp.

Function: tlist-length (tlist)

Return the length of the given TLIST, or NIL if the TLIST is circular.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tninth (tlist)

Return the 9th object in a TLIST or NIL if there is no 9th object.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tninth) (tlist)

Set the 9th object in a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tnth (n tlist)

Return the Nth object in a TLIST where the TCAR is the zero-th element.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tnth) (n tlist)

Set the Nth element of TLIST to NEWVAL.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tnthcdr (n tlist)

Performs the TCDR function N times on a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tpairlis (keys data &optional talist)

Construct an association list from KEYS and DATA (adding to TALIST).

Package

stmx.util.

Source

tcons-alist.lisp.

Function: transaction-abort ()

Voluntarily abort a hardware memory transaction
with an error-code equal to +transaction-user-abort+.

If a transaction is in progress, TRANSACTION-ABORT does not return normally: execution is resumed at the instruction immediately after the outermost TRANSACTION-BEGIN.

If called without an active transaction, TRANSACTION-ABORT returns normally with an implementation-dependent value.

Package

stmx.asm.

Source

transaction.lisp.

Function: transaction-begin ()

Start a hardware memory transaction.
Return +transaction-started+ if transaction started successfully, otherwise return code of the error that caused the transaction to abort.

Invoking TRANSACTION-BEGIN while there is already a running hardware memory transaction has implementation-dependent effects.

Package

stmx.asm.

Source

transaction.lisp.

Function: transaction-end ()

Commit a hardware memory transaction.
Return normally (with an implementation-dependent value) if commit is successful, otherwise abort the transaction.

In case the transaction is aborted, all effects of code between TRANSACTION-BEGIN and TRANSACTION-END are rolled back (undone):
execution resumes at the instruction immediately after TRANSACTION-BEGIN,
in such a way that TRANSACTION-BEGIN will appear to have returned
a non-zero error code (that describes the abort reason).

Invoking TRANSACTION-END without a running hardware memory transaction
has undefined consequences.

Package

stmx.asm.

Source

transaction.lisp.

Function: transaction-rerun-may-succeed-p (err-code)

If ERR-CODE is the result returned by (TRANSACTION-BEGIN) of an *aborted* transaction, return T if re-running the same transaction has a possibility to succeed,
i.e. if the abort reason was temporary (as for example a conflict with another thread). Return NIL if re-running the same transaction has no possibility to succeed.

Package

stmx.asm.

Source

transaction.lisp.

Function: transaction-running-p ()

Return T if a hardware memory transaction is currently in progress, otherwise return NIL.

Package

stmx.asm.

Source

transaction.lisp.

Function: transaction-supported-p ()

Test for RTM, i.e. hardware memory transactions.
RTM is supported if (cpuid 7) returns ebx with bit 11 set. If a processor does not support HLE, trying to execute the assembler instructions XBEGIN, XEND, XABORT and XTEST will generate faults.

Package

stmx.asm.

Source

cpuid.lisp.

Function: transaction? ()

Return true if inside a software or hardware transaction.

Package

stmx.

Source

classes.lisp.

Function: trassoc (item talist &key key test test-not)

Return the cons in TALIST whose tcdr is equal (by a given test or EQL) to the ITEM.

Package

stmx.util.

Source

tcons-alist.lisp.

Function: trest (tlist)

Return the rest element in a TCONS or TLIST.

Package

stmx.util.

Source

tcons.lisp.

Setf expander for this function

(setf trest).

Function: try-acquire-mutex (mutex)

Try to acquire MUTEX. Return T if successful, or NIL if MUTEX was already locked.

Package

stmx.lang.

Source

mutex.lisp.

Function: tsecond (tlist)

Return the 2nd object in a TLIST or NIL if there is no 2nd object.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tsecond) (tlist)

Set the 2nd object in a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tseventh (tlist)

Return the 7th object in a TLIST or NIL if there is no 7th object.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tseventh) (tlist)

Set the 7th object in a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tsixth (tlist)

Return the 6th object in a TLIST or NIL if there is no 6th object.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tsixth) (tlist)

Set the 6th object in a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tstack ()

Create and return a new TSTACK.

Package

stmx.util.

Source

tstack.lisp.

Function: tsvref (tvec index)

Return the INDEX-th element of simple-tvector TVEC. Works both inside and outside transactions

Package

stmx.util.

Source

simple-tvector.lisp.

Setf expander for this function

(setf tsvref).

Function: ttenth (tlist)

Return the 10th object in a TLIST or NIL if there is no 10th object.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf ttenth) (tlist)

Set the 10th object in a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: tthird (tlist)

Return the 3rd object in a TLIST or NIL if there is no 3rd object.

Package

stmx.util.

Source

tcons-list.lisp.

Function: (setf tthird) (tlist)

Set the 3rd object in a TLIST.

Package

stmx.util.

Source

tcons-list.lisp.

Function: ttree-equal (x y &key test test-not)

Return T if X and Y are isomorphic TLIST trees with identical leaves.

Package

stmx.util.

Source

tcons-tree.lisp.

Function: ttree-equal-test (x y test)
Package

stmx.util.

Source

tcons-tree.lisp.

Function: ttree-equal-test-not (x y test-not)
Package

stmx.util.

Source

tcons-tree.lisp.

Function: tvar (&optional value)
Package

stmx.

Source

tvar.lisp.

Function: unbind-$ (var)

Unbind the value inside transactional variable VAR.
Works both outside and inside transactions.

During transactions, it uses transaction log to record the ’unbound’ value.

Package

stmx.

Source

tvar-slot.lisp.

Function: wait4-thread (th)
Package

stmx.lang.

Source

thread.lisp.

Function: ~ (obj)
Package

stmx.lang.

Source

print.lisp.

Function: (setf ~) (obj)
Package

stmx.lang.

Source

print.lisp.


6.1.7 Generic functions

Generic Function: empty! (place)

Remove all values contained in PLACE. Return PLACE.

Package

stmx.util.

Source

container.lisp.

Methods
Method: empty! ((q bheap))

Remove all values from bheap Q. Return Q.

Source

bheap.lisp.

Method: empty! ((p tport))
Source

tchannel.lisp.

Method: empty! ((f tfifo))
Source

tfifo.lisp.

Method: empty! ((s tstack))
Source

tstack.lisp.

Method: empty! ((cell tcell))

Remove value from CELL. Return CELL.

Source

tcell.lisp.

Method: empty! ((var tvar))

Remove value from tvar.

Source

tvar.lisp.

Generic Function: empty? (place)

Return nil if PLACE contains at least one value, otherwise return t.

Package

stmx.util.

Source

container.lisp.

Methods
Method: empty? ((q bheap))

Return t if bheap Q is empty.

Source

bheap.lisp.

Method: empty? ((p tport))
Source

tchannel.lisp.

Method: empty? ((c tchannel))

Tchannels are write-only: it is never possible to read values from them, so assume they are always empty and return t.

Source

tchannel.lisp.

Method: empty? ((f tfifo))
Source

tfifo.lisp.

Method: empty? ((s tstack))
Source

tstack.lisp.

Method: empty? ((cell tcell))
Source

tcell.lisp.

Method: empty? ((var tvar))
Source

tvar.lisp.

Generic Function: full? (place)

Return t if PLACE cannot contain more values, otherwise return nil.

Package

stmx.util.

Source

container.lisp.

Methods
Method: full? ((q bheap))

A bheap is never full, so this method always returns nil.

Source

bheap.lisp.

Method: full? ((p tport))

Tports are read-only: it is never possible to store values in them, so assume they are always full and return t.

Source

tchannel.lisp.

Method: full? ((c tchannel))

Tchannels can contain unlimited values: they are never full, so always return nil.

Source

tchannel.lisp.

Method: full? ((f tfifo))

A tfifo is never full, so this method always returns nil.

Source

tfifo.lisp.

Method: full? ((s tstack))

A tstack is never full, so this method always returns nil.

Source

tstack.lisp.

Method: full? (place)

Default implementation: assumes that PLACE can contain only one value.

Generic Function: id-of (obj)
Package

stmx.lang.

Source

print.lisp.

Methods
Method: id-of ((log tlog))
Source

classes.lisp.

Method: id-of ((var tvar))
Source

tvar-fwd.lisp.

Method: id-of (obj)
Generic Function: (setf id-of) (obj)
Package

stmx.lang.

Source

print.lisp.

Methods
Method: (setf id-of) (obj)
Generic Function: peek (place &optional default)

Return one value stored in PLACE without removing it, and t as multiple values. If PLACE contains no values, return (values DEFAULT nil).

Package

stmx.util.

Source

container.lisp.

Methods
Method: peek ((q bheap) &optional default)

Return the first value in bheap Q without removing it, and t as multiple values. Return (values DEFAULT nil) if Q contains no values.

Source

bheap.lisp.

Method: peek ((p tport) &optional default)

Return the first value in tport P without removing it, and t as multiple values. Return (values DEFAULT nil) if P contains no value.

Source

tchannel.lisp.

Method: peek ((f tfifo) &optional default)

Return the first value in tfifo F without removing it, and t as multiple values. Return (values DEFAULT nil) if F contains no value.

Source

tfifo.lisp.

Method: peek ((s tstack) &optional default)

Return the first value in tstack S without removing it, and t as multiple values. Return (values DEFAULT nil) if S contains no values.

Source

tstack.lisp.

Method: peek ((cell tcell) &optional default)
Source

tcell.lisp.

Method: peek ((var tvar) &optional default)
Source

tvar.lisp.

Generic Function: put (place value)

Wait until PLACE can contain more values, then store VALUE in it and return VALUE.

Package

stmx.util.

Source

container.lisp.

Methods
Method: put ((q bheap) value)

Store VALUE in bheap Q. Return VALUE.

Source

bheap.lisp.

Method: put ((c tchannel) value)

Append VALUE as last element in tchannel C and return VALUE.
Since tchannel can contain unlimited values, this method never blocks.

Source

tchannel.lisp.

Method: put ((f tfifo) value)

Append VALUE as last element in tfifo F and return VALUE.
Since tfifo can contain unlimited values, this method never blocks.

Source

tfifo.lisp.

Method: put ((s tstack) value)

Insert VALUE as first element in tstack S and return VALUE. Since tstack can contain unlimited values, this method never blocks.

Source

tstack.lisp.

Method: put ((cell tcell) value)
Source

tcell.lisp.

Method: put ((var tvar) value)
Source

tvar.lisp.

Generic Function: take (place)

Wait until PLACE contains at least one value, then remove and return one value.

Package

stmx.util.

Source

container.lisp.

Methods
Method: take ((p tport))

Wait until tport P contains at least one value, then remove and return the first value.

Source

tchannel.lisp.

Method: take ((f tfifo))

Wait until tfifo F contains at least one value, then remove and return the first value.

Source

tfifo.lisp.

Method: take ((s tstack))

Wait until tstack S contains at least one value, then remove and return the first value.

Source

tstack.lisp.

Method: take ((cell tcell))
Source

tcell.lisp.

Method: take ((var tvar))
Source

tvar.lisp.

Generic Function: try-put (place value)

If PLACE can contain more values, store VALUE it and return t and VALUE as multiple values. Otherwise return (values nil nil)

Package

stmx.util.

Source

container.lisp.

Methods
Method: try-put ((q bheap) value)

Store VALUE in bheap Q. Return t and VALUE This method never fails.

Source

bheap.lisp.

Method: try-put ((c tchannel) value)

Append VALUE to tchannel C and return (values t VALUE).
Since tchannel can contain unlimited values, this method never fails.

Source

tchannel.lisp.

Method: try-put ((f tfifo) value)

Append VALUE as last element in tfifo F and return (values t VALUE). Since tfifo can contain unlimited values, this method never fails.

Source

tfifo.lisp.

Method: try-put ((s tstack) value)

Append VALUE to tstack S and return (values t VALUE).
Since fifo can contain unlimited values, this method never fails.

Source

tstack.lisp.

Method: try-put ((cell tcell) value)

hand-made, nonblocking version of (put place) for tcells. less general but approx. 3 times faster (on SBCL 1.0.57.0.debian, Linux amd64) than the unspecialized (try-put place) which calls (atomic (nonblocking (put place value)))

Source

tcell.lisp.

Method: try-put ((var tvar) value)

hand-made, nonblocking version of (put place) for TVARs.
Less general but approx. 3 times faster (on SBCL 1.0.57.0.debian, Linux amd64) than the unspecialized (try-put place) which calls (atomic (nonblocking (put place value)))

Source

tvar.lisp.

Method: try-put (place value)

this method shows a general technique to convert a blocking, atomic operation into a nonblocking, atomic one: simply wrap it in (atomic (nonblocking ...))

Generic Function: try-take (place)

If PLACE contains at least one value, remove one value and return t and it as multiple values. Otherwise return (values nil nil)

Package

stmx.util.

Source

container.lisp.

Methods
Method: try-take ((q bheap))

If bheap S contains at least one value, remove the first value and return t and the first value as multiple values. Otherwise return (values nil nil)

Source

bheap.lisp.

Method: try-take ((p tport))

If tport P contains at least one value, remove the first value and return t and the first value as multiple values. Otherwise return (values nil nil)

Source

tchannel.lisp.

Method: try-take ((f tfifo))

If tfifo F contains at least one value, remove the first value and return t and the first value as multiple values. Otherwise return (values nil nil)

Source

tfifo.lisp.

Method: try-take ((s tstack))

If tstack S contains at least one value, remove the first value and return t and the first value as multiple values. Otherwise return (values nil nil)

Source

tstack.lisp.

Method: try-take ((cell tcell))

hand-made, nonblocking version of (take place) for cells. less general but approx. 3 times faster (on SBCL 1.0.57.0.debian, Linux amd64) than the unspecialized (try-take place) which calls (atomic (nonblocking (take place)))

Source

tcell.lisp.

Method: try-take ((var tvar))

hand-made, nonblocking version of (take place) for TVARs. Less general but approx. 3 times faster (on SBCL 1.0.57.0.debian, Linux amd64) than the unspecialized (try-take place) which calls (atomic (nonblocking (take place)))

Source

tvar.lisp.

Method: try-take (place)

this method shows a general technique to convert a blocking, atomic operation into a nonblocking, atomic one: simply wrap it in (atomic (nonblocking ...))


6.1.8 Standalone methods

Method: compute-effective-slot-definition ((class transactional-class) slot-name direct-slots)

Compose DIRECT-SLOTS coming from CLASS and all is superclasses into a single EFFECTIVE-SLOT.

If more than one transactional-direct-slot with the same name is present,
ensure that all of them have the same :transactional flag value (all T or all NIL), otherwise signal an error.

Package

sb-mop.

Source

tclass.lisp.

Method: direct-slot-definition-class ((class transactional-class) &rest initargs)
Package

sb-mop.

Source

tclass.lisp.

Method: effective-slot-definition-class ((class transactional-class) &rest initargs)
Package

sb-mop.

Source

tclass.lisp.

Method: initialize-instance :before ((obj-6 tcell) &key &allow-other-keys)

Put a TVAR into every transactional direct slot of TCELL *before* the normal slots initialization.

Source

tcell.lisp.

Method: initialize-instance :before ((obj-6 tchannel) &key &allow-other-keys)

Put a TVAR into every transactional direct slot of TCHANNEL *before* the normal slots initialization.

Source

tchannel.lisp.

Method: initialize-instance :after ((hash ghash-table) &rest other-keys &key initial-capacity)
Source

ghash-table.lisp.

Method: initialize-instance :after ((m gmap) &key &allow-other-keys)
Source

gmap.lisp.

Method: initialize-instance :after ((f tfifo) &key &allow-other-keys)

Initialize tfifo F.

Source

tfifo.lisp.

Method: initialize-instance :before ((obj-0 tfifo) &key &allow-other-keys)

Put a TVAR into every transactional direct slot of TFIFO *before* the normal slots initialization.

Source

tfifo.lisp.

Method: initialize-instance :before ((obj-0 tstack) &key &allow-other-keys)

Put a TVAR into every transactional direct slot of TSTACK *before* the normal slots initialization.

Source

tstack.lisp.

Method: initialize-instance :before ((obj-0 tmap) &key &allow-other-keys)

Put a TVAR into every transactional direct slot of TMAP *before* the normal slots initialization.

Source

tmap.lisp.

Method: initialize-instance :after ((hash thash-table) &rest other-keys)
Source

thash-table.lisp.

Method: initialize-instance :before ((obj-0 thash-table) &key &allow-other-keys)

Put a TVAR into every transactional direct slot of THASH-TABLE *before* the normal slots initialization.

Source

thash-table.lisp.

Method: initialize-instance :after ((p tport) &key &allow-other-keys)

Initialize the reading tport P for a multicast tchannel.

Source

tchannel.lisp.

Method: initialize-instance :before ((obj-2 tport) &key &allow-other-keys)

Put a TVAR into every transactional direct slot of TPORT *before* the normal slots initialization.

Source

tchannel.lisp.

Method: initialize-instance :before ((obj-0 tnode) &key &allow-other-keys)

Put a TVAR into every transactional direct slot of TNODE *before* the normal slots initialization.

Source

tmap.lisp.

Method: initialize-instance :before ((obj-0 thash-pair) &key &allow-other-keys)

Put a TVAR into every transactional direct slot of THASH-PAIR *before* the normal slots initialization.

Source

thash-table.lisp.

Method: initialize-instance :after ((q bheap) &key &allow-other-keys)

Initialize bheap Q.

Source

bheap.lisp.

Method: make-load-form ((obj gv156) &optional environment)
Source

global-clock.lisp.

Method: print-object ((var tvar) stream-0)
Source

tvar.lisp.

Method: print-object ((obj tlog) stream-0)
Source

tlog.lisp.

Method: print-object ((obj txpair) stream)
Source

txhash.lisp.

Method: print-object ((obj tcell) stream-0)
Source

tcell.lisp.

Method: print-object ((obj tcons) stream-0)
Source

tcons.lisp.

Method: print-object ((obj ghash-table) stream-0)
Source

ghash-table.lisp.

Method: print-object ((obj gmap) stream-0)
Source

gmap.lisp.

Method: print-object ((obj tfifo) stream-0)
Source

tfifo.lisp.

Method: print-object ((obj tstack) stream-0)
Source

tstack.lisp.

Method: print-object ((obj ghash-pair) stream-0)
Source

ghash-table.lisp.

Method: print-object ((q bheap) stream-0)
Source

bheap.lisp.

Method: slot-boundp-using-class ((class transactional-class) instance (slot transactional-effective-slot))
Package

sb-mop.

Source

tslot.lisp.

Method: slot-makunbound-using-class ((class transactional-class) instance (slot transactional-effective-slot))
Package

sb-mop.

Source

tslot.lisp.

Method: (setf slot-value-using-class) ((class transactional-class) instance (slot transactional-effective-slot))
Package

sb-mop.

Source

tslot.lisp.

Method: slot-value-using-class ((class transactional-class) instance (slot transactional-effective-slot))
Package

sb-mop.

Source

tslot.lisp.

Method: update-instance-for-redefined-class :before ((instance transactional-object) added-slots discarded-slots property-list &key &allow-other-keys)

Put TVARs into all newly-added transactional slots of INSTANCE

Source

tslot.lisp.

Method: validate-superclass ((class transactional-class) (superclass standard-class))
Package

sb-mop.

Source

tclass.lisp.


6.1.9 Structures

Structure: atomic-counter
Package

stmx.lang.

Source

atomic-counter.lisp.

Direct superclasses

structure-object.

Direct subclasses

gv156.

Direct slots
Slot: version
Type

stmx.lang:atomic-counter-slot-type

Initform

0

Readers

atomic-counter-version.

Writers

(setf atomic-counter-version).

Structure: fast-vector
Package

stmx.lang.

Source

fast-vector.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: len
Type

fixnum

Initform

0

Readers

fast-vector-len.

Writers

(setf fast-vector-len).

Slot: vec
Type

simple-vector

Initform

stmx.lang::+empty-vector+

Readers

fast-vector-vec.

Writers

(setf fast-vector-vec).

Slot: initial-element
Initform

0

Readers

fast-vector-initial-element.

Writers

(setf fast-vector-initial-element).

Structure: mutex
Package

stmx.lang.

Source

mutex.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: mutex-owner
Type

stmx.lang::atomic-t

Readers

mutex-owner.

Writers

(setf mutex-owner).

Structure: tcons

Transactional cell holding two values. It is the STM equivalent of CONS cells.
To use TCONS cells, prepend T to the name of most list-manipulating functions. Examples: (CONS a b) -> (TCONS a b)
(LIST ...) -> (TLIST ...)
(FIRST c) -> (TFIRST c)
(REST c) -> (TREST c) and so on

Package

stmx.util.

Source

tcons.lisp.

Direct superclasses

structure-object.

Direct methods

print-object.

Direct slots
Slot: first
Package

common-lisp.

Type

(stmx:transactional t)

Initform

(stmx::tstruct-slot-initialize (quote stmx.util:tcons) (quote first) (quote nil))

Readers

%stmx-impl/tstruct/tcons-first.

Writers

(setf %stmx-impl/tstruct/tcons-first).

Slot: rest
Package

common-lisp.

Type

(stmx:transactional t)

Initform

(stmx::tstruct-slot-initialize (quote stmx.util:tcons) (quote rest) (quote nil))

Readers

%stmx-impl/tstruct/tcons-rest.

Writers

(setf %stmx-impl/tstruct/tcons-rest).

Structure: tvar

a transactional variable (tvar) is the smallest unit of transactional memory. it contains a single value that can be read or written during a transaction using ($-slot var) and (setf ($-slot var) value).

tvars are seldom used directly, since transactional objects (tobjs) wrap them with a more convenient interface: you can read and write normally the slots of a transactional object (with slot-value, accessors ...), and behind
the scenes the slots will be stored in transactional memory implemented by tvars.

Package

stmx.

Source

tvar-fwd.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: version
Type

stmx::version-type

Initform

stmx::+invalid-version+

Readers

tvar-version.

Writers

(setf tvar-version).

Slot: value
Initform

stmx:+unbound-tvar+

Readers

tvar-value.

Writers

(setf tvar-value).

Slot: id
Type

fixnum

Initform

stmx::+invalid-version+

Readers

tvar-id.

Writers

This slot is read-only.

Slot: waiting-for
Type

(or null hash-table)

Readers

tvar-waiting-for.

Writers

(setf tvar-waiting-for).

Slot: waiting-lock
Initform

(bordeaux-threads:make-lock "tvar-waiting")

Readers

tvar-waiting-lock.

Writers

This slot is read-only.


6.1.10 Classes

Class: ghash-table

Generic hash-table. Allows custom :test argument at creation - default is ’eql. If :test is not one of ’eq ’eql or ’equal, also requires explicit :hash argument at creation.

Not so useful by itself (standard CL:HASH-TABLE is usually faster),
it is the base for transactional hash-table implementation THASH-TABLE.

Package

stmx.util.

Source

ghash-table.lisp.

Direct subclasses

thash-table.

Direct methods
Direct slots
Slot: vec
Type

(or stmx.util::ghash-vector stmx:tvar)

Slot: test-fun
Type

stmx.util::ghash-test-fun

Slot: hash-fun
Type

stmx.util::ghash-hash-fun

Slot: aref-fun
Type

stmx.util::ghash-aref-fun

Initform

(function svref)

Slot: set-aref-fun
Type

stmx.util::ghash-set-aref-fun

Initform

(function stmx.util::set-svref)

Slot: count
Package

common-lisp.

Type

(or null fixnum stmx:tvar)

Initform

0

Slot: test-sym
Type

symbol

Initform

(quote eql)

Initargs

:test

Slot: hash-sym
Type

symbol

Initargs

:hash

Class: gmap

Generic binary tree

Package

stmx.util.

Source

gmap.lisp.

Direct subclasses

rbmap.

Direct methods
Direct slots
Slot: root
Type

(or null stmx.util::gmap-node stmx:tvar)

Slot: pred-func
Type

function

Readers

pred-function-of.

Writers

This slot is read-only.

Slot: count
Package

common-lisp.

Type

(or null fixnum stmx:tvar)

Initform

0

Readers

count-of.

Writers

This slot is read-only.

Slot: pred-sym
Type

symbol

Initargs

:pred

Readers

pred-of.

Writers

This slot is read-only.

Class: rbmap

Red-black tree implementation of sorted binary map

Package

stmx.util.

Source

rbmap.lisp.

Direct superclasses

gmap.

Direct subclasses

tmap.

Direct methods
Class: tcell
Package

stmx.util.

Source

tcell.lisp.

Direct superclasses

transactional-object.

Direct methods
Direct slots
Slot: value
Initform

stmx.util::+empty-tcell+

Initargs

:value

Class: tchannel

Transactional multicast channel supporting unlimited reading ports.
Values written into the tchannel are available to all reading ports in the same order.

References to values written into the tchannel are kept only as long as
one or more ports still need to read them.

Package

stmx.util.

Source

tchannel.lisp.

Direct superclasses

transactional-object.

Direct methods
Direct slots
Slot: back
Type

(or stmx.util:tcons stmx:tvar)

Initform

(stmx.util:tcons nil nil)

Readers

back-of.

Writers

(setf back-of).

Class: tfifo
Package

stmx.util.

Source

tfifo.lisp.

Direct superclasses

transactional-object.

Direct methods
Direct slots
Slot: front
Type

(or stmx.util:tcons stmx:tvar)

Readers

front-of.

Writers

(setf front-of).

Slot: back
Type

(or stmx.util:tcons stmx:tvar)

Readers

back-of.

Writers

(setf back-of).

Class: thash-table

Transactional hash table.

Package

stmx.util.

Source

thash-table.lisp.

Direct superclasses
Direct methods
Direct slots
Slot: vec
Slot: count
Package

common-lisp.

Class: tmap

Transactional sorted map, implemented with red-black tree

Package

stmx.util.

Source

tmap.lisp.

Direct superclasses
Direct methods
Direct slots
Slot: root
Type

(or (or null stmx.util::tnode) stmx:tvar)

Slot: count
Package

common-lisp.

Slot: foo
Class: tport

Transactional reading port for a multicast tchannel.
Values written into the tchannel are available to all reading ports in the same order.

Package

stmx.util.

Source

tchannel.lisp.

Direct superclasses

transactional-object.

Direct methods
Direct slots
Slot: front
Type

(or cons stmx:tvar)

Readers

front-of.

Writers

(setf front-of).

Slot: channel
Type

stmx.util:tchannel

Initform

(error "missing :channel argument instantiating ~a or a subclass" (quote stmx.util:tport))

Initargs

:channel

Readers

channel-of.

Writers

This slot is read-only.

Class: transactional-class

The metaclass for transactional classes.

Classes defined with this metaclass have extra slot options, see the class TRANSACTIONAL-DIRECT-SLOT for details.

Package

stmx.

Source

tclass.lisp.

Direct superclasses

standard-class.

Direct methods
Class: transactional-object

Superclass of all transactional objects.

Package

stmx.

Source

tclass.lisp.

Direct subclasses
Direct methods

update-instance-for-redefined-class.

Class: tstack
Package

stmx.util.

Source

tstack.lisp.

Direct superclasses

transactional-object.

Direct methods
Direct slots
Slot: top
Type

(or list stmx:tvar)

Initargs

stmx.util::top

Readers

top-of.

Writers

(setf top-of).


6.1.11 Types

Type: atomic-counter-num ()
Package

stmx.lang.

Source

atomic-counter.lisp.

Type: atomic-counter-slot-type ()
Package

stmx.lang.

Source

atomic-counter.lisp.

Type: atomic-num ()

ATOMIC-NUM must be a type suitable for ATOMIC-INCF and ATOMIC-DECF. STMX also assumes it is the same or wider than fixnum.

Package

stmx.lang.

Source

atomic-ops.lisp.

Type: simple-tvector (&optional length)

SIMPLE-TVECTOR is a transactional, one dimensional array. It is currently a deftype, not a class or struct: methods cannot be specialized on it.

Package

stmx.util.

Source

simple-tvector.lisp.

Type: tlist ()
Package

stmx.util.

Source

tcons.lisp.

Type: transactional (type)

Transactional memory containing TYPE

Package

stmx.

Source

tvar-fwd.lisp.


6.2 Internals


6.2.1 Constants

Constant: +black+
Package

stmx.util.

Source

rbmap.lisp.

Constant: +defknown-has-overwrite-fndb-silently+
Package

stmx.asm.

Source

compiler.lisp.

Constant: +empty-tcell+

Empty TCELL objects actually contain this symbol in their VALUE slot. Use with care.

Package

stmx.util.

Source

tcell.lisp.

Constant: +ghash-default-capacity+

Default initial capacity of a GHASH-TABLE.

Package

stmx.util.

Source

ghash-table.lisp.

Constant: +ghash-max-capacity+

Maximum capacity of a GHASH-TABLE.
Equal to MOST-POSITIVE-FIXNUM rounded down to nearest power of 2.

Package

stmx.util.

Source

ghash-table.lisp.

Constant: +ghash-threshold-capacity+
Package

stmx.util.

Source

ghash-table.lisp.

Constant: +global-clock-delta+

+global-clock+ VERSION is incremented by 2 each time: the lowest bit is reserved as "locked" flag in TVARs versioning - used if TVAR-LOCK feature is equal to :BIT.

Package

stmx.

Source

global-clock.lisp.

Constant: +global-clock-nohw-delta+

+global-clock+ NOHW-COUNTER incremented by 2 each time: the lowest bit is reserved as "prevent HW transactions"

Package

stmx.

Source

global-clock.lisp.

Constant: +gv+
Package

stmx.

Source

global-clock.lisp.

Constant: +gv-max-stat+
Package

stmx.

Source

global-clock.lisp.

Constant: +hw-atomic-max-attempts+
Package

stmx.

Source

hw-atomic.lisp.

Constant: +invalid-version+
Package

stmx.

Source

tvar-fwd.lisp.

Constant: +red+
Package

stmx.util.

Source

rbmap.lisp.

Constant: +txhash-default-capacity+
Package

stmx.

Source

classes.lisp.

Constant: +txhash-threshold-capacity+
Package

stmx.

Source

txhash.lisp.

Constant: k<
Package

stmx.util.

Source

misc.lisp.

Constant: k=
Package

stmx.util.

Source

misc.lisp.

Constant: k>
Package

stmx.util.

Source

misc.lisp.


6.2.2 Special variables

Special Variable: *cons-pool*
Package

stmx.lang.

Source

cons.lisp.

Special Variable: *empty-vector*
Package

stmx.util.

Source

bheap.lisp.

Special Variable: *feature-list*
Package

stmx.lang.

Source

features.lisp.

Special Variable: *hide-tvars*

A boolean controlling the behaviour of the function (slot-value)
and of slot accessors for TOBJs slots:
- if false, (slot-value) and accessors will get or set the actual TVAR stored inside the slot.
- if true, (slot-value) and accessors will get or set the value stored inside the slot’s TVAR.

This flag is almost always true; it is temporarily set to false during some MOP calls (slot-value-using-class ...) that implement access to TOBJs slots.

Package

stmx.

Source

classes.lisp.

Special Variable: *hw-tlog-write-version*
Package

stmx.

Source

classes.lisp.

Special Variable: *lv*
Package

stmx.

Source

global-clock.lisp.

Special Variable: *optimized-funs*
Package

stmx.

Source

optimize-for.lisp.

Special Variable: *print-ids*
Package

stmx.lang.

Source

print.lisp.

Special Variable: *record-to-tlogs*

A flag indicating if transactions are being recorded to TLOGs or not.

Recording is normally enabled during transactions,
while it is normally disabled in these cases:
- outside transactions
- when initializing TOBJs slots
- during some MOP calls (slot-value-using-class etc.) that implement access to TOBJs slots.

Package

stmx.

Source

classes.lisp.

Special Variable: *recursive-call-compute-effective-slot-definition*
Package

stmx.

Source

tclass.lisp.

Special Variable: *recursive-call-list-classes-containing-direct-slots*
Package

stmx.

Source

tclass.lisp.

Special Variable: *tlog*

The current transaction log.

Package

stmx.

Source

classes.lisp.

Special Variable: *tlog-pool*
Package

stmx.

Source

tlog.lisp.

Special Variable: *tvar-id*
Package

stmx.

Source

tvar-fwd.lisp.

Special Variable: +dummy-tvar+
Package

stmx.

Source

txhash.lisp.

Special Variable: +empty-vector+
Package

stmx.lang.

Source

fast-vector.lisp.

Special Variable: +it+
Package

stmx.lang.

Source

macro.lisp.


6.2.3 Macros

Macro: %copy-tlist-consing (list-or-tlist &key car cdr consp)
Package

stmx.util.

Source

tcons-list.lisp.

Macro: %copy-tlist-setf-tvar (list-or-tlist &key car cdr consp)
Package

stmx.util.

Source

tcons-list.lisp.

Macro: %gv-expand (name &rest args)
Package

stmx.

Source

global-clock.lisp.

Macro: %gv-nohw-flag ()
Package

stmx.

Source

global-clock.lisp.

Macro: %gvx-expand (gvx name &rest args)
Package

stmx.

Source

global-clock.lisp.

Macro: %hw-atomic2 ((&key hw-write-version err test-for-running-tx? update-stat) body fallback)

Run BODY in a hardware memory transaction.
If the transaction aborts, retry it as long as it has chances to succeed. If it has no chances to succeed, execute FALLBACK.
Warning: if a transaction is already running, execute BODY inside it

Package

stmx.

Source

hw-atomic.lisp.

Macro: %sxhash-equalp (x)
Package

stmx.util.

Source

misc.lisp.

Macro: %t-assoc (item talist key test test-not tcar)
Package

stmx.util.

Source

tcons-alist.lisp.

Macro: %tappend-consing (lists &key do-outer-list do-inner-list)
Package

stmx.util.

Source

tcons-list.lisp.

Macro: %tappend-setf-tvar (lists &key do-outer-list do-inner-list)
Package

stmx.util.

Source

tcons-list.lisp.

Macro: %tassoc (item talist key test test-not)
Package

stmx.util.

Source

tcons-alist.lisp.

Macro: %tlist-get (tlist op &rest next-ops)
Package

stmx.util.

Source

tcons-list.lisp.

Macro: %tlist-set (value tcons op &rest next-ops)
Package

stmx.util.

Source

tcons-list.lisp.

Macro: %trassoc (item talist key test test-not)
Package

stmx.util.

Source

tcons-alist.lisp.

Macro: _ (obj slot)
Package

stmx.util.

Source

misc.lisp.

Macro: atomic-push (obj place)

Like PUSH, but atomic. PLACE may be read multiple times before the operation completes – the write does not occur until such time that no other thread modified PLACE between the read and the write.

Works only on places supported by ATOMIC-COMPARE-AND-SWAP.

Package

stmx.lang.

Source

atomic-ops.lisp.

Macro: compile-cerror (cont-string format &rest args)
Package

stmx.

Source

classes.lisp.

Macro: compile-error (format &rest args)
Package

stmx.

Source

classes.lisp.

Macro: compile-log-warn (&rest args)
Package

stmx.lang.

Source

thread.lisp.

Macro: current-tlog ()

Return the current software transaction log

Package

stmx.

Source

classes.lisp.

Macro: define-method-initialize-instance (class-name direct-slot-forms)
Package

stmx.

Source

tclass.lisp.

Macro: define-tstruct-slot-accessor (reader writer accessor-impl &key type struct-type read-only tx instance value)
Package

stmx.

Source

tstruct.lisp.

Macro: defknown (&rest args)
Package

stmx.asm.

Source

compiler.lisp.

Macro: do-class-transactional-direct-slots ((slot class) &body body)

Execute BODY on every transactional direct slot (not inherited) of CLASS.

Package

stmx.

Source

tclass.lisp.

Macro: do-class-transactional-effective-slots ((slot class) &body body)

Execute BODY on every transactional slot (direct or inherited) of CLASS.

Package

stmx.

Source

tclass.lisp.

Macro: do-filter-txfifo ((key &optional value) fifo &body body)

Execute BODY on each KEY/VALUE contained in FIFO. Return NIL.

Package

stmx.

Source

txhash.lisp.

Macro: do-filter-txfifo-entries ((pair) fifo &body body)

Execute BODY on each TXPAIR contained in FIFO. Return NIL.

Package

stmx.

Source

txhash.lisp.

Macro: do-ghash-pairs ((pair &optional index) hash &body body)

Execute BODY on each GHASH-PAIR pair contained in HASH. Return NIL.

Package

stmx.util.

Source

ghash-table.lisp.

Macro: do-gmap* ((&key key value index from-end) m &body body)

Execute BODY in order on each key/value pair contained in M:
first execute it on the smallest key, then the second smallest... finally execute BODY on the largest key. Return nil.

If :FROM-END is true, BODY will be executed first on the largest key, then on the second largest key... and finally on the smallest key.

Adding or removing keys from M during this call (even from other threads) has undefined consequences. Not even the current key can be removed.

Package

stmx.util.

Source

gmap.lisp.

Macro: do-loop-tstruct-defs ((struct-def-var struct-def) &body body)

Execute BODY inside a loop, iterating on tstruct-def STRUCT-DEF and all its superclasses

Package

stmx.

Source

tstruct.lisp.

Macro: do-tlist ((var tlist &optional result) &body body)

Analogous to DOLIST, iterates on transactional list TLIST.
On each iteration, sets VAR to the element and executes BODY inside a tagbody. Returns RESULT. Note: when RESULT is executed, VAR is set to NIL.

An implicit block named NIL surrounds DO-TLIST, so RETURN can be used
to terminate immediately the iterations and return zero or more values.

Package

stmx.util.

Source

tcons.lisp.

Macro: do-tstruct-defs ((struct-def-var struct-def) &body body)

Execute BODY on tstruct-def STRUCT-DEF and all its superclasses

Package

stmx.

Source

tstruct.lisp.

Macro: do-txfifo ((key &optional value) fifo &body body)

Execute BODY on each KEY/VALUE contained in FIFO. Return NIL.

Package

stmx.

Source

txhash.lisp.

Macro: do-txfifo-entries ((pair) fifo &body body)

Execute BODY on each TXPAIR contained in FIFO. Return NIL.

Package

stmx.

Source

txhash.lisp.

Macro: do-txhash ((key &optional value) hash &body body)

Execute BODY on each KEY/VALUE contained in HASH. Return NIL.

Package

stmx.

Source

txhash.lisp.

Macro: do-txhash-entries ((pair) hash &body body)

Execute BODY on each TXPAIR pair contained in HASH. Return NIL.

Package

stmx.

Source

txhash.lisp.

Macro: fast-sw-atomic (&rest body)
Package

stmx.

Source

sw-atomic.lisp.

Macro: global-clock/decf-nohw-counter ()

Decrement by one the number of software-only transaction commits currently running.

This function must be called at the end of each software-only transaction commit, (retry), or any other operation incompatible with hardware transactions, in order to let the latter run, since their current implementations are mutually incompatible.

Package

stmx.

Source

global-clock.lisp.

Macro: global-clock/features ()

Return the features of the GLOBAL-CLOCK algorithm, i.e. a list containing zero or more of :SUITABLE-FOR-HW-TRANSACTIONS and :SPURIOUS-FAILURES-IN-SINGLE-THREAD. The list of possible features will be expanded as more GLOBAL-CLOCK algorithms are implemented.

Package

stmx.

Source

global-clock.lisp.

Macro: global-clock/get-nohw-counter ()

Return the number of operations currently running that are incompatible with hardware transactions. Example of operations that AT THE MOMENT are incompatible with hardware transactions include:
1) software-only transaction commits
2) (retry)

This function must be called at the beginning of each hardware transaction
in order to detect if an incompatible operation is started during the hardware transaction, and abort the transaction in such case.

Package

stmx.

Source

global-clock.lisp.

Macro: global-clock/hw/after-abort ()

Return the value to use as new transaction "read version",

This function must be called after a hardware transaction failed/aborted and before rerunning it.

Package

stmx.

Source

global-clock.lisp.

Macro: global-clock/hw/start-read ()

Return the value to use as hardware transaction "read version".

This function must be invoked once upon starting a hardware transaction for the first time. In case the transaction just aborted and is being re-executed, invoke instead (GLOBAL-CLOCK/HW/AFTER-ABORT).

Package

stmx.

Source

global-clock.lisp.

Macro: global-clock/hw/start-write (read-version)

Return the value to use as hardware transaction "write version",
given the transaction current READ-VERSION that was assigned at transaction start.

During hardware transactions - and also during hardware-based commits of software transactions - this function must be called once before writing the first TVAR.

Package

stmx.

Source

global-clock.lisp.

Macro: global-clock/hw/stat-aborted ()
Package

stmx.

Source

global-clock.lisp.

Macro: global-clock/hw/stat-committed ()
Package

stmx.

Source

global-clock.lisp.

Macro: global-clock/hw/write (write-version)

Return the value to use as TVAR "write version", given the hardware transaction current WRITE-VERSION that was assigned by GLOBAL-CLOCK/HW/START-WRITE before the transaction started writing to TVARs.

This function must be called for **each** TVAR being written during hardware-assisted commit phase of software transactions
and during pure hardware transactions.

Package

stmx.

Source

global-clock.lisp.

Macro: global-clock/incf-nohw-counter ()

Increment by one the number of operations currently running that are incompatible with hardware transactions.

This function must be called at the beginning of each software-only transaction commit, (retry), or any other operation incompatible with hardware transactions, in order to abort the latter, since their current implementations are mutually incompatible.

Package

stmx.

Source

global-clock.lisp.

Macro: global-clock/sw/after-abort ()

Return the value to use as new transaction "read version",

This function must be called after a software transaction failed/aborted and before rerunning it.

Package

stmx.

Source

global-clock.lisp.

Macro: global-clock/sw/start-read ()

Return the value to use as software transaction "read version".

This function must be invoked once upon starting a software transaction for the first time. In case the transaction just aborted and is being re-executed, invoke instead (GLOBAL-CLOCK/SW/AFTER-ABORT).

Package

stmx.

Source

global-clock.lisp.

Macro: global-clock/sw/start-write (read-version)

Return the value to use as softarw transaction "write version", given the software transaction current READ-VERSION that was assigned at transaction start.

During software-only commits, this function must be called once before committing the first TVAR write.

Package

stmx.

Source

global-clock.lisp.

Macro: global-clock/sw/stat-aborted ()
Package

stmx.

Source

global-clock.lisp.

Macro: global-clock/sw/stat-committed ()
Package

stmx.

Source

global-clock.lisp.

Macro: global-clock/sw/write (write-version)

Return the value to use as TVAR "write version", given the software transaction current WRITE-VERSION that was assigned by GLOBAL-CLOCK/SW/START-WRITE before the transaction started writing to TVARs.

Fhis function must be called for **each** TVAR being written
during software-only commit phase of software transactions.

Package

stmx.

Source

global-clock.lisp.

Macro: global-clock/valid-read? (tvar-version read-version)

Return T if TVAR-VERSION is compatible with transaction "read version". If this function returns NIL, the transaction must be aborted.

During software transactions, this function must be invoked after every TVAR read and before returning the TVAR value to the application code. During hardware transactions, this function is not used.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/after-abort ()

This is GV1 implementation of GLOBAL-CLOCK/AFTER-ABORT. Return the current +gv+ value.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/decf-nohw-counter ()

This is GV1 implementation of GV1/DECF-NOHW-COUNTER. It does nothing and returns zero.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/features ()

This is GV1 implementation of GLOBAL-CLOCK/FEATURES.

Return nil, i.e. not ’(:suitable-for-hw-transactions) because (GV1/START-WRITE ...) increments the global clock, which causes conflicts and aborts when multiple hardware transactions are running simultaneously.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/get-nohw-counter ()

This is GV1 implementation of GV1/GET-NOHW-COUNTER. It does nothing and returns zero.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/hw/after-abort ()

This is GV1 implementation of GLOBAL-CLOCK/HW/AFTER-ABORT. Calls GV1/AFTER-ABORT.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/hw/start-read ()

This is GV1 implementation of GLOBAL-CLOCK/HW/START-READ. Calls GV1/START-READ.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/hw/start-write (write-version)

This is GV1 implementation of GLOBAL-CLOCK/HW/START-WRITE. Calls GV1/START-WRITE.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/hw/stat-aborted ()

This is GV1 implementation of GLOBAL-CLOCK/HW/STAT-ABORTED. Calls GV1/STAT-ABORTED.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/hw/stat-committed ()

This is GV1 implementation of GLOBAL-CLOCK/HW/STAT-COMMITTED. Calls GV1/STAT-COMMITTED.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/hw/write (write-version)

This is GV1 implementation of GLOBAL-CLOCK/HW/WRITE. Calls GV1/WRITE.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/incf-nohw-counter ()

This is GV1 implementation of GV1/INCF-NOHW-COUNTER. It does nothing and returns zero.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/start-read ()

This is GV1 implementation of GLOBAL-CLOCK/START-READ. Return the current +gv+ value.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/start-write (read-version)

This is GV1 implementation of GLOBAL-CLOCK/START-WRITE. Atomically increment +gv+ and return its new value.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/stat-aborted ()

This is GV1 implementation of GV1/STAT-ABORTED. It does nothing and returns zero.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/stat-committed ()

This is GV1 implementation of GV1/STAT-COMMITTED. It does nothing and returns zero.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/sw/after-abort ()

This is GV1 implementation of GLOBAL-CLOCK/SW/AFTER-ABORT. Calls GV1/AFTER-ABORT.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/sw/start-read ()

This is GV1 implementation of GLOBAL-CLOCK/SW/START-READ. Calls GV1/START-READ.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/sw/start-write (write-version)

This is GV1 implementation of GLOBAL-CLOCK/SW/START-WRITE. Calls GV1/START-WRITE.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/sw/stat-aborted ()

This is GV1 implementation of GLOBAL-CLOCK/SW/STAT-ABORTED. Calls GV1/STAT-ABORTED.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/sw/stat-committed ()

This is GV1 implementation of GLOBAL-CLOCK/SW/STAT-COMMITTED. Calls GV1/STAT-COMMITTED.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/sw/write (write-version)

This is GV1 implementation of GLOBAL-CLOCK/SW/WRITE. Calls GV1/WRITE.

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/valid-read? (tvar-version read-version)

This is GV1 implementation of GLOBAL-CLOCK/VALID-READ? Return (<= tvar-version read-version)

Package

stmx.

Source

global-clock.lisp.

Macro: gv1/write (write-version)

This is GV1 implementation of GLOBAL-CLOCK/WRITE. Return WRITE-VERSION.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/after-abort ()

This is GV5 implementation of GLOBAL-CLOCK/AFTER-ABORT. Increment +gv+ and return its new value.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/decf-nohw-counter (&optional delta)

This is GV5 implementation of GLOBAL-CLOCK/DECF-NOHW-COUNTER. Decrement by DELTA the slot NOHW-COUNTER of +gv+ and return its new value.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/features ()

This is GV5 implementation of GLOBAL-CLOCK/FEATURES.

Return ’(:SUITABLE-FOR-HW-TRANSACTIONS :SPURIOUS-FAILURES-IN-SINGLE-THREAD) because the global clock is incremented only by GV5/AFTER-ABORT, which avoids incrementing it in GV5/START-WRITE (it would cause hardware transactions
to conflict with each other and abort) but also causes a 50% abort rate (!) even in a single, isolated thread reading and writing its own transactional memory.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/get-nohw-counter ()

This is GV5 implementation of GLOBAL-CLOCK/GET-NOHW-COUNTER.
Return the number of software-only transaction commits currently running.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/hw/after-abort ()

This is GV5 implementation of GLOBAL-CLOCK/HW/AFTER-ABORT. Calls GV5/AFTER-ABORT.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/hw/start-read ()

This is GV5 implementation of GLOBAL-CLOCK/HW/START-READ. Calls GV5/START-READ.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/hw/start-write (write-version)

This is GV5 implementation of GLOBAL-CLOCK/HW/START-WRITE. Calls GV5/START-WRITE.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/hw/stat-aborted ()

This is GV5 implementation of GLOBAL-CLOCK/HW/STAT-ABORTED. Calls GV5/STAT-ABORTED.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/hw/stat-committed ()

This is GV5 implementation of GLOBAL-CLOCK/HW/STAT-COMMITTED. Calls GV5/STAT-COMMITTED.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/hw/write (write-version)

This is GV5 implementation of GLOBAL-CLOCK/HW/WRITE. Calls GV5/WRITE.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/incf-nohw-counter (&optional delta)

This is GV5 implementation of GLOBAL-CLOCK/INCF-NOHW-COUNTER. Increment by DELTA the slot NOHW-COUNTER of +gv+ and return its new value.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/start-read ()

This is GV5 implementation of GLOBAL-CLOCK/START-READ. Return the current +gv+ value.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/start-write (read-version)

This is GV5 implementation of GLOBAL-CLOCK/START-WRITE. Return (1+ +gv+) without incrementing it.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/stat-aborted ()

This is GV5 implementation of GV5/STAT-ABORTED. It does nothing and returns zero.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/stat-committed ()

This is GV5 implementation of GV5/STAT-COMMITTED. It does nothing and returns zero.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/sw/after-abort ()

This is GV5 implementation of GLOBAL-CLOCK/SW/AFTER-ABORT. Calls GV5/AFTER-ABORT.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/sw/start-read ()

This is GV5 implementation of GLOBAL-CLOCK/SW/START-READ. Calls GV5/START-READ.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/sw/start-write (write-version)

This is GV5 implementation of GLOBAL-CLOCK/SW/START-WRITE. Calls GV5/START-WRITE.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/sw/stat-aborted ()

This is GV5 implementation of GLOBAL-CLOCK/SW/STAT-ABORTED. Calls GV5/STAT-ABORTED.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/sw/stat-committed ()

This is GV5 implementation of GLOBAL-CLOCK/SW/STAT-COMMITTED. Calls GV5/STAT-COMMITTED.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/sw/write (write-version)

This is GV5 implementation of GLOBAL-CLOCK/SW/WRITE. Calls GV5/WRITE.

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/valid-read? (tvar-version read-version)

This is GV5 implementation of GLOBAL-CLOCK/VALID-READ? Return (<= tvar-version read-version)

Package

stmx.

Source

global-clock.lisp.

Macro: gv5/write (write-version)

This is GV5 implementation of GLOBAL-CLOCK/{HW,SW}/WRITE. Return WRITE-VERSION.

Package

stmx.

Source

global-clock.lisp.

Macro: gv6/%is-gv5-mode? ()

Return T if GV6 is currently in GV5 mode, i.e. it allows HW transactions. Return NIL if GV6 is currently in GV1 mode, i.e. it forbids HW transactions.

Package

stmx.

Source

global-clock.lisp.

Macro: gv6/%update-lv-stat (which &optional delta)
Package

stmx.

Source

global-clock.lisp.

Macro: gv6/decf-nohw-counter (&optional delta)

This is GV6 implementation of GLOBAL-CLOCK/DECF-NOHW-COUNTER. Calls (GV5/DECF-NOHW-COUNTER).

Package

stmx.

Source

global-clock.lisp.

Macro: gv6/features ()

This is GV6 implementation of GLOBAL-CLOCK/FEATURES.

Return ’(:SUITABLE-FOR-HW-TRANSACTIONS :SPURIOUS-FAILURES-IN-SINGLE-THREAD) just like GV5 because the global clock is based on GV5: it is usually not incremented by GV6/START-WRITE, to prevent hardware transactions from conflicting with each other.
This can cause very high abort rates of software transactions, so
GV6 adaptively switches to GV1 algorithm in the following cases:
a) software-only commits are in progress
b) abort rate is very high
in order to try to reduce the abort rates.

Package

stmx.

Source

global-clock.lisp.

Macro: gv6/get-nohw-counter ()

This is GV6 implementation of GLOBAL-CLOCK/GET-NOHW-COUNTER. Return LOGIOR of two quantities:
1. (GV5/GET-NOHW-COUNTER)
2. the global-clock slot NOHW-FLAG

Package

stmx.

Source

global-clock.lisp.

Macro: gv6/hw/after-abort ()

This is GV6 implementation of GLOBAL-CLOCK/HW/AFTER-ABORT.
Calls (GV5/AFTER-ABORT), since GV1 mode forbids hardware transactions.

Package

stmx.

Source

global-clock.lisp.

Macro: gv6/hw/start-read ()

This is GV6 implementation of GLOBAL-CLOCK/HW/START-READ.
Calls (GV5/HW/START-READ), since GV1 mode forbids hardware transactions.

Package

stmx.

Source

global-clock.lisp.

Macro: gv6/hw/start-write (read-version)

This is GV6 implementation of GLOBAL-CLOCK/HW/START-WRITE.
Calls (GV5/HW/START-WRITE), since GV1 mode forbids hardware transactions.

Package

stmx.

Source

global-clock.lisp.

Macro: gv6/hw/stat-aborted ()

This is GV5 implementation of GLOBAL-CLOCK/HW/STAT-ABORTED.
It increases local-clock slot ABORTS and may decide to switch between GV1 and GV5 modes.

Package

stmx.

Source

global-clock.lisp.

Macro: gv6/hw/stat-committed ()

This is GV6 implementation of GLOBAL-CLOCK/HW/STAT-COMMITTED.
It increases local-clock slot COMMITS and may decide to switch between GV1 and GV5 modes.

Package

stmx.

Source

global-clock.lisp.

Macro: gv6/hw/write (write-version)

This is GV6 implementation of GLOBAL-CLOCK/SW/WRITE.
Calls (GV5/HW/START-WRITE), since GV1 mode forbids hardware transactions.

Package

stmx.

Source

global-clock.lisp.

Macro: gv6/incf-nohw-counter (&optional delta)

This is GV6 implementation of GLOBAL-CLOCK/INCF-NOHW-COUNTER. Calls (GV5/INCF-NOHW-COUNTER).

Package

stmx.

Source

global-clock.lisp.

Macro: gv6/stat-aborted ()

This is GV6 implementation of GV6/STAT-ABORTED. It does nothing and returns zero.

Package

stmx.

Source

global-clock.lisp.

Macro: gv6/stat-committed ()

This is GV6 implementation of GV6/STAT-COMMITTED. It does nothing and returns zero.

Package

stmx.

Source

global-clock.lisp.

Macro: gv6/sw/after-abort ()

This is GV6 implementation of GLOBAL-CLOCK/SW/AFTER-ABORT.
Calls either (GV5/AFTER-ABORT) or (GV1/AFTER-ABORT), depending on the current mode.

Package

stmx.

Source

global-clock.lisp.

Macro: gv6/sw/start-read ()

This is GV6 implementation of GLOBAL-CLOCK/SW/START-READ.
Calls either (GV5/SW/START-READ) or (GV1/SW/START-READ), depending on the current mode.

Package

stmx.

Source

global-clock.lisp.

Macro: gv6/sw/start-write (read-version)

This is GV6 implementation of GLOBAL-CLOCK/SW/START-WRITE.
Calls either (GV5/START-WRITE) or (GV1/START-WRITE), depending on the current mode.

Package

stmx.

Source

global-clock.lisp.

Macro: gv6/sw/stat-aborted ()

This is GV5 implementation of GLOBAL-CLOCK/SW/STAT-ABORTED.
It increases local-clock slot ABORTS and may decide to switch between GV1 and GV5 modes.

Package

stmx.

Source

global-clock.lisp.

Macro: gv6/sw/stat-committed ()

This is GV6 implementation of GLOBAL-CLOCK/SW/STAT-COMMITTED.
It increases local-clock slot COMMITS and may decide to switch between GV1 and GV5 modes.

Package

stmx.

Source

global-clock.lisp.

Macro: gv6/sw/write (write-version)

This is GV6 implementation of GLOBAL-CLOCK/HW/WRITE.
Calls either (GV5/SW/WRITE) or (GV1/WRITE), depending on the current mode.

Package

stmx.

Source

global-clock.lisp.

Macro: gv6/valid-read? (tvar-version read-version)

This is GV6 implementation of GLOBAL-CLOCK/VALID-READ? Return (<= tvar-version read-version)

Package

stmx.

Source

global-clock.lisp.

Macro: gvx-add-missing (gvx)
Package

stmx.

Source

global-clock.lisp.

Macro: hw-tlog-write-version ()

Return the WRITE-VERSION for the current hardware transaction

Package

stmx.

Source

classes.lisp.

Macro: incf-hash-counter (which)
Package

stmx.lang.

Source

hash-table.lisp.

Macro: log.debug-gmap (&rest args &key &allow-other-keys)
Package

stmx.util.

Source

gmap.lisp.

Macro: maybe-yield-before-rerun ()
Package

stmx.

Source

classes.lisp.

Macro: options-for-defun ((&key inline block-name defsetf-name) (defun name args &body body))
Package

stmx.

Source

optimize-for.lisp.

Macro: slot-raw-tvar (class instance slot)

Return the raw tvar stored in a transactional slot.

Package

stmx.

Source

tslot.lisp.

Macro: sw-atomic (&rest body)

Run BODY in a software memory transaction. All changes to transactional memory will be visible to other threads only after BODY returns normally (commits). If BODY signals an error, its effects on transactional memory are rolled back and the error is propagated normally.
Also, no work-in-progress transactional memory will ever be visible to other threads.

Package

stmx.

Source

sw-atomic.lisp.

Macro: transaction-abort-macro (&optional err-code)

Immediately abort a hardware memory transaction with a user-specified ERR-CODE, which must be a constant between 0 and 255 (default: 1).
Note: the value returned by (transaction-begin) will also contain "somewhere" the bits of ERR-CODE, but will have a different value.
See Intel x86-64 CPU instruction reference manual, section TSX, for details.

If a transaction is in progress, TRANSACTION-ABORT-MACRO does not return normally: execution is resumed at the instruction immediately after the outermost TRANSACTION-BEGIN.

If called without a running transaction, TRANSACTION-ABORT-MACRO returns normally with an implementation-dependent value.

Package

stmx.asm.

Source

transaction.lisp.

Macro: tvar-id/next ()
Package

stmx.

Source

tvar-fwd.lisp.

Macro: tvar-unwrap-slot-macro (object slot-name)
Package

stmx.

Source

tclass.lisp.

Macro: tvar-wrap-slot-macro (object slot-name)
Package

stmx.

Source

tclass.lisp.

Macro: use-$-hwtx? ()

Return T if $-hwtx and (setf $-hwtx) should be used, otherwise return NIL.

Package

stmx.

Source

tvar.lisp.

Macro: use-$-swtx? ()

Return T if $-swtx and (setf $-swtx) should be used, otherwise return NIL.

Package

stmx.

Source

tvar.lisp.

Macro: validate-tlog-pool ()
Package

stmx.

Source

tlog.lisp.

Macro: with-declares ((declares &optional var-body) func-body &body body)
Package

stmx.

Source

optimize-for.lisp.

Macro: with-docstrings ((docstrings &optional var-body) func-body &body body)
Package

stmx.

Source

optimize-for.lisp.

Macro: with-docstrings-declares ((docstrings declares &optional var-body) func-body &body body)
Package

stmx.

Source

optimize-for.lisp.

Macro: with-hwtx (&body body)
Package

stmx.

Source

optimize-for.lisp.

Macro: with-notx (&body body)
Package

stmx.

Source

optimize-for.lisp.

Macro: with-recording (&body body)

Enable recording of reads and writes to TLOGs while executing BODY.

Package

stmx.

Source

classes.lisp.

Macro: with-recording-to-tlog (log &body body)

Use LOG as the current transaction log and enable recording of transactions to TLOGs while executing BODY.

Package

stmx.

Source

classes.lisp.

Macro: with-ro-slots ((&rest slots) instance &body body)
Package

stmx.util.

Source

misc.lisp.

Macro: with-rw-slots ((&rest slots) instance &body body)
Package

stmx.util.

Source

misc.lisp.

Macro: with-swtx (&body body)
Package

stmx.

Source

optimize-for.lisp.

Macro: with-tlog (log &body body)

Use LOG as the current software transaction log while executing BODY.

Package

stmx.

Source

classes.lisp.

Macro: with-tx ((kind) &body body)
Package

stmx.

Source

optimize-for.lisp.

Macro: without-recording-with-show-tvars (&body body)

Disable recording of transactions to TLOGs and disable hiding TVARs inside TOBJs slots while executing BODY.

Package

stmx.

Source

classes.lisp.


6.2.4 Setf expanders

Setf Expander: (setf $-notx) (var)
Package

stmx.

Source

tvar.lisp.

Reader

$-notx (function).

Writer

set-$-notx (function).

Setf Expander: (setf $-swtx) (var &optional log)
Package

stmx.

Source

tvar.lisp.

Reader

$-swtx (function).


6.2.5 Ordinary functions

Function: $-notx (var)

Get the value from the transactional variable VAR and return it. Return +unbound-tvar+ if VAR is not bound to a value.
Works ONLY outside memory transactions.

Package

stmx.

Source

tvar.lisp.

Setf expander for this function

(setf $-notx).

Function: $-swtx (var &optional log)

Get the value from the transactional variable VAR and return it. Return +unbound-tvar+ if VAR is not bound to a value.
Works ONLY inside software memory transactions.

Package

stmx.

Source

tvar.lisp.

Setf expander for this function

(setf $-swtx).

Function: %coerce-to-fun (thing)
Package

stmx.util.

Source

tcons-alist.lisp.

Function: %enable-#?-syntax ()
Package

stmx.lang.

Source

features-reader.lisp.

Function: %gv-expand0-f (name)
Package

stmx.

Source

global-clock.lisp.

Function: %gvx-expand0-f (prefix suffix)
Package

stmx.

Source

global-clock.lisp.

Function: %impl/names-to-symbol (package &rest names)
Package

stmx.

Source

tstruct.lisp.

Function: %make-atomic-counter (&key version)
Package

stmx.lang.

Source

atomic-counter.lisp.

Function: %make-fast-vector (&key len vec initial-element)
Package

stmx.lang.

Source

fast-vector.lisp.

Function: %make-mutex (&key mutex-owner)
Package

stmx.lang.

Source

mutex.lisp.

Function: %make-txfifo (&key front back)
Package

stmx.

Source

classes.lisp.

Function: %make-txhash-table (&key vec count pool)
Package

stmx.

Source

classes.lisp.

Function: %rbmap-rebalance-after-insert (m stack)

Rebalance red-black tree after adding a child to (first stack).
Return (values node stack) for some rebalanced node and its path from root. If stack is nil, returned node is the new root to set.

Package

stmx.util.

Source

rbmap.lisp.

Function: %rbmap-remove-at (m stack)

Remove (first stack) from red-black tree M and return (values some-node that-node-stack) from rebalanced tree. Some-node will be nil only if the tree is empty after removal.

Package

stmx.util.

Source

rbmap.lisp.

Function: %rbmap-remove-black-node-at (m node stack)

Remove from red-black tree M black leaf NODE, whose path is STACK. Return some node in rebalanced tree and its stack as multiple values

Package

stmx.util.

Source

rbmap.lisp.

Function: %run-sw-atomic (tx)

Function equivalent of the SW-ATOMIC macro.

Run the function TX inside a transaction.
If the transaction is invalid (conflicts) re-run TX immediately, ignoring any error it may signal.

Otherwise, commit if TX returns normally, or rollback if it signals an error.

Finally, if TX called (retry), re-run it after at least some of the transactional memory it read has changed.

Package

stmx.

Source

sw-atomic.lisp.

Function: %stmx-impl/notx-set/$-slot (value var)
Package

stmx.

Source

tvar-slot.lisp.

Function: %stmx-impl/notx-set/tcar (value cons)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/notx-set/tcdr (value cons)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/notx-set/tcons-first (value instance)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/notx-set/tcons-rest (value instance)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/notx-set/tfirst (value cons)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/notx-set/trest (value cons)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/notx/$-slot (var)
Setf Expander: (setf %stmx-impl/notx/$-slot) (var)
Package

stmx.

Source

tvar-slot.lisp.

Function: %stmx-impl/notx/bound-$? (var)
Package

stmx.

Source

tvar-slot.lisp.

Function: %stmx-impl/notx/peek-$ (var default)
Package

stmx.

Source

tvar-slot.lisp.

Function: %stmx-impl/notx/set-tsvref (tvec index value)
Package

stmx.util.

Source

simple-tvector.lisp.

Function: %stmx-impl/notx/tcar (list)
Setf Expander: (setf %stmx-impl/notx/tcar) (cons)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/notx/tcdr (list)
Setf Expander: (setf %stmx-impl/notx/tcdr) (cons)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/notx/tcons-first (instance)
Setf Expander: (setf %stmx-impl/notx/tcons-first) (instance)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/notx/tcons-rest (instance)
Setf Expander: (setf %stmx-impl/notx/tcons-rest) (instance)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/notx/tfirst (tlist)
Setf Expander: (setf %stmx-impl/notx/tfirst) (cons)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/notx/trest (tlist)
Setf Expander: (setf %stmx-impl/notx/trest) (cons)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/notx/trplaca (tcons x)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/notx/trplacd (tcons x)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/notx/try-put-$ (var value default)
Package

stmx.

Source

tvar-slot.lisp.

Function: %stmx-impl/notx/try-take-$ (var default)
Package

stmx.

Source

tvar-slot.lisp.

Function: %stmx-impl/notx/tsvref (tvec index)
Package

stmx.util.

Source

simple-tvector.lisp.

Function: %stmx-impl/notx/unbind-$ (var)
Package

stmx.

Source

tvar-slot.lisp.

Function: %stmx-impl/swtx-set/$-slot (value var)
Package

stmx.

Source

tvar-slot.lisp.

Function: %stmx-impl/swtx-set/tcar (value cons)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/swtx-set/tcdr (value cons)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/swtx-set/tcons-first (value instance)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/swtx-set/tcons-rest (value instance)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/swtx-set/tfirst (value cons)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/swtx-set/trest (value cons)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/swtx/$-slot (var)
Setf Expander: (setf %stmx-impl/swtx/$-slot) (var)
Package

stmx.

Source

tvar-slot.lisp.

Function: %stmx-impl/swtx/bound-$? (var)
Package

stmx.

Source

tvar-slot.lisp.

Function: %stmx-impl/swtx/peek-$ (var default)
Package

stmx.

Source

tvar-slot.lisp.

Function: %stmx-impl/swtx/set-tsvref (tvec index value)
Package

stmx.util.

Source

simple-tvector.lisp.

Function: %stmx-impl/swtx/tcar (list)
Setf Expander: (setf %stmx-impl/swtx/tcar) (cons)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/swtx/tcdr (list)
Setf Expander: (setf %stmx-impl/swtx/tcdr) (cons)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/swtx/tcons-first (instance)
Setf Expander: (setf %stmx-impl/swtx/tcons-first) (instance)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/swtx/tcons-rest (instance)
Setf Expander: (setf %stmx-impl/swtx/tcons-rest) (instance)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/swtx/tfirst (tlist)
Setf Expander: (setf %stmx-impl/swtx/tfirst) (cons)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/swtx/trest (tlist)
Setf Expander: (setf %stmx-impl/swtx/trest) (cons)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/swtx/trplaca (tcons x)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/swtx/trplacd (tcons x)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/swtx/try-put-$ (var value default)
Package

stmx.

Source

tvar-slot.lisp.

Function: %stmx-impl/swtx/try-take-$ (var default)
Package

stmx.

Source

tvar-slot.lisp.

Function: %stmx-impl/swtx/tsvref (tvec index)
Package

stmx.util.

Source

simple-tvector.lisp.

Function: %stmx-impl/swtx/unbind-$ (var)
Package

stmx.

Source

tvar-slot.lisp.

Function: %stmx-impl/tstruct/make-tcons (&key first rest)
Package

stmx.util.

Source

tcons.lisp.

Reader: %stmx-impl/tstruct/tcons-first (instance)
Writer: (setf %stmx-impl/tstruct/tcons-first) (instance)
Package

stmx.util.

Source

tcons.lisp.

Target Slot

first.

Reader: %stmx-impl/tstruct/tcons-rest (instance)
Writer: (setf %stmx-impl/tstruct/tcons-rest) (instance)
Package

stmx.util.

Source

tcons.lisp.

Target Slot

rest.

Function: %stmx-impl/tx-set/$-slot (value var)
Package

stmx.

Source

tvar-slot.lisp.

Function: %stmx-impl/tx-set/tcar (value cons)

Set VALUE as the first element in a TCONS or non-null TLIST. This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/tx-set/tcdr (value cons)

Set VALUE as the rest element in a TCONS or non-null TLIST.
This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/tx-set/tcons-first (value instance)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/tx-set/tcons-rest (value instance)
Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/tx-set/tfirst (value cons)

Set VALUE as the first element in a TCONS or non-null TLIST.

This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons.lisp.

Function: %stmx-impl/tx-set/trest (value cons)

Set VALUE as the rest element in a TCONS or non-null TLIST.

This function should always be executed inside an STMX atomic block.

Package

stmx.util.

Source

tcons.lisp.

Function: %tlast0 (list)
Package

stmx.util.

Source

tcons-list.lisp.

Function: %tlast1 (list)
Package

stmx.util.

Source

tcons-list.lisp.

Function: %tvar-version-and-value (var)

Internal function used only by TVAR-VALUE-AND-VERSION-OR-FAIL.

Package

stmx.

Source

tvar-fwd.lisp.

Function: %validate-tlog-pool (&optional pool)
Package

stmx.

Source

tlog.lisp.

Function: add-bheap (q value)

Add VALUE to bheap Q. Return VALUE.

Package

stmx.util.

Source

bheap.lisp.

Function: add-optimized-fun (fun fun-hwtx fun-swtx fun-notx lambda-list)
Package

stmx.

Source

optimize-for.lisp.

Function: add-optimized-fun* (fun simple-vector)
Package

stmx.

Source

optimize-for.lisp.

Function: add-txpair-to-pool (hash txpair)
Package

stmx.

Source

txhash.lisp.

Function: adjust-transactional-slot-form (class-name class-precedence-list slot-form old-effective-slot errors)

Adjust a single slot definition for a transactional class.
Unless the slot is defined as :transactional NIL,
wrap its :initform with a TVAR and alter its :type to also accept TVARs

Package

stmx.

Source

tclass.lisp.

Function: adjust-transactional-slot-forms (class-name direct-superclasses-names slot-forms errors)

Adjust each slot definition for a transactional class:
unless a slot is defined as :transactional NIL, wrap its :initform with a TVAR and alter its :type to also accept TVARs

Package

stmx.

Source

tclass.lisp.

Function: atomic-counter-p (object)
Package

stmx.lang.

Source

atomic-counter.lisp.

Reader: atomic-counter-version (instance)
Writer: (setf atomic-counter-version) (instance)
Package

stmx.lang.

Source

atomic-counter.lisp.

Target Slot

version.

Function: bind-optimized-fun (fun fun-tx lambda-list)

Return a form suitable for MACROLET

Package

stmx.

Source

optimize-for.lisp.

Function: black? (node)

Return t if NODE is black. Nil nodes are assumed to be black

Package

stmx.util.

Source

rbmap.lisp.

Function: cerror-tclass-slot-change (class-name slot-name option old-value new-value)
Package

stmx.

Source

tclass.lisp.

Function: check-tclass-slot-change (class-name slot-name option old-value new-value errors)
Package

stmx.

Source

tclass.lisp.

Function: check-tclass-slot-name (class-name slot-name errors)
Package

stmx.

Source

tclass.lisp.

Function: clear-bheap (q)

Remove all values from bheap Q. Return Q.

Package

stmx.util.

Source

bheap.lisp.

Function: clear-features ()

Remove all features from *FEATURE-LIST*.

Package

stmx.lang.

Source

features.lisp.

Function: clear-tlog (log)

Remove all transactional reads and writes stored in LOG,
as well as functions registered with BEFORE-COMMIT and AFTER-COMMIT; return LOG itself.

Package

stmx.

Source

tlog.lisp.

Function: clear-txfifo (fifo)
Package

stmx.

Source

txhash.lisp.

Function: clear-txhash (hash)

Remove all keys and values from HASH. Return HASH.

Package

stmx.

Source

txhash.lisp.

Function: clos-tie-breaker-rule (minimal-elements reverse-precedence-list)
Package

stmx.lang.

Source

class-precedence-list.lisp.

Function: collect-all-superclasses (classes-names)
Package

stmx.lang.

Source

class-precedence-list.lisp.

Function: collect-superclasses (class)
Package

stmx.lang.

Source

class-precedence-list.lisp.

Function: commit (log)

Commit a TLOG to memory.

It returns a boolean specifying whether or not the transaction
log was committed. If the transaction log cannot be committed
it either means that:
a) the TLOG is invalid - then the whole transaction must be re-executed b) another TLOG is writing the same TVARs being committed
so that TVARs locks could not be aquired - also in this case
the whole transaction will be re-executed, as there is little hope that the TLOG will still be valid.

Note: internally invokes GLOBAL-CLOCK/{HW,SW}/STAT-{COMMITTED,ABORTED}

Package

stmx.

Source

commit.lisp.

Function: commit-nested (log)

Commit LOG into its parent log; return LOG.

Unlike (commit log), this function is guaranteed to always succeed.

Implementation note: copy tlog-reads, tlog-writes, tlog-before-commit and tlog-after-commit into parent, or swap them with parent

Package

stmx.

Source

commit.lisp.

Function: commit-sw-update-tvars (locked log)

Actually COMMIT, i.e. write new values into TVARs. Also unlock all TVARs.

Package

stmx.

Source

commit.lisp.

Function: compare-bheap-entries (q n1 n2)

Compare entries at positions N1 and N2 in bqueue Q.

Package

stmx.util.

Source

bheap.lisp.

Function: compare-keys (pred key1 key2)

Compare KEY1 agains KEY2 using the comparison function PRED. Return K< if KEY1 compares as lesser than KEY2,
return K> if KEY1 compares as greater than KEY2,
return K= if KEY1 and KEY2 compare as equal.

Package

stmx.util.

Source

misc.lisp.

Function: compile-ensure-1-arg (ch args)
Package

stmx.lang.

Source

features-reader.lisp.

Function: compile-ensure-2-args (ch args)
Package

stmx.lang.

Source

features-reader.lisp.

Function: compile-if-and (ch args)

Return T if all the features in ARGS are present in *FEATURE-LIST*, otherwise return NIL.

Package

stmx.lang.

Source

features-reader.lisp.

Function: compile-if-eql (ch args)

Return T if feature has the specified value, otherwise return NIL.

Package

stmx.lang.

Source

features-reader.lisp.

Function: compile-if-error (ch args)
Package

stmx.lang.

Source

features-reader.lisp.

Function: compile-if-eval (ch args)
Package

stmx.lang.

Source

features-reader.lisp.

Function: compile-if-not (ch args)

Return NIL if the feature in ARGS is present in *FEATURE-LIST*, otherwise return T.

Package

stmx.lang.

Source

features-reader.lisp.

Function: compile-if-or (ch args)

Return T if at least one feature in ARGS is present in *FEATURE-LIST*, otherwise return NIL.

Package

stmx.lang.

Source

features-reader.lisp.

Function: compile-if-sbcl-disassem<=32-bit ()
Package

stmx.asm.

Source

compiler.lisp.

Function: compile-if-sbcl-lacks-rtm-instructions ()
Package

stmx.asm.

Source

compiler.lisp.

Function: