News for hackers. Stuff that matters.
Re:Clojure 1.9 is now available by flavio81 on Saturday December 09, 2017 @01:50AM (#15884643)
>readily available and with a few lines of code

1. Declare the classes you want to work under transactional memory as transactional... by wrapping them in such a way:

    (transactional (defclass ...))
2. Whenever you need to do a STM transaction, just wrap the critical code within (atomic):

    (atomic (do-stuff ...  ))
Is it hard? Nope. The above example is one easy way to do it in Common Lisp, using the STMX library, which of course you can download, compile and load with one line of code:

    (ql:quickload "stmx")
So yes, it is easy under Clojure, but not only in Clojure.

There are no comments on this comment yet.