4 ms·
Apparently I also answered my own question a year ago as a comment on the associated blog post: Reagents do generalise CML. The main difference is that CML onl
by jules 8y ago
Apparently I also answered my own question a year ago as a comment on the associated blog post:
Reagents do generalise CML. The main difference is that CML only allows you to combine operations with select (op1 OR op2) while Reagents also allow you to combine operations into a transaction (op1 AND op2 for independent operations and op1 THEN op2 for dependent ones). Reagents are lightweight in that the library analyses the combined operation and then figures out an efficient CAS scheme to execute it. Reagents also include some more low level operations, such as CAS as a reagent. -- https://wingolog.org/archives/2017/06/29/a-new-concurrent-ml#e65f4a9c7419cf15c71a58df4786a1a15f8066e9 https://wingolog.org/archives/2017/06/29/a-new-concurrent-ml...
I hope that's correct...
> Reagents are more comparable to STM I would say, even though it is slightly less expressive in some areas, but on the other hand is always lock-free.
What is the difference in expressiveness between STM and Reagents? Is it that STM provides monadic bind, whereas Reagents only provide applicative, i.e. Reagents cannot dynamically decide to update different locations based on values read in the transaction?
- bjoli 8y agoWell, after having used reagents I have found that for most things so use it to more or less implement CML anyway. I have never been limited by the CML way, but I do appreciate the power that reagents give you. In comparing STM and reagents I will probably just regurgitate what Aaron Turin says in his paper "Reagents: Expressing and Composing Fine-grained Concurrency" which you can find using a short Google. I only seem to be able to copy the Google link, so you will have to Google it yourself.