Skip to content

Instantly share code, notes, and snippets.

@AeroNotix
Created September 21, 2018 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AeroNotix/fd0d7c4d62ac35ff2095d7bfcd6ab8de to your computer and use it in GitHub Desktop.
Save AeroNotix/fd0d7c4d62ac35ff2095d7bfcd6ab8de to your computer and use it in GitHub Desktop.
(ql:quickload :stmx)
(defparameter y 0)
(defmacro set-it (it)
`(let ((success nil)
(started? (stmx.lang:hw-transaction-begin))
(r (random 100)))
(when (eq started? stmx.lang:+hw-transaction-started+)
(setf ,it r)
(setf success t)
(stmx.lang:hw-transaction-end))
started?))
(length
(sb-sys:without-gcing
(remove stmx.lang:+hw-transaction-started+
(loop for i upto 100000
collect
(set-it y)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment