Hi Peter
After you pointed me to the Akka Website, I found the information I
was looking for on
http://doc.akkasource.org/stm-java. The sections
"Retries" and "Unexpected retries" explained exactly the strange
behavior I was encountering, when I added some logging statements to
your transfer method:
Thread[main,5,main]: before to.SetBalance()
Thread[main,5,main]: before to.SetBalance()
Thread[main,5,main]: before from.SetBalance()
Thread[main,5,main]: before to.SetBalance()
Thread[main,5,main]: before from.SetBalance()
Thread[main,5,main]: done
Thread[main,5,main]: before to.SetBalance()
Thread[main,5,main]: before from.SetBalance()
Thread[main,5,main]: done
After reading these sections, I guess that I see just what has been
described in "Unexpected retries".
Is there similar content on the Multiverse web site as well and I was
just not seeing it? If not, it would surely make sense to add it (and
may be you can add information about the just release version 0.6 as
well).
I also have a question regarding the performance. I was running the
transfer method 1'000'000 times:
- using the traditional synchronized approach, it took 0.1 s
- with @TransactionalMethod, it took 2.2 s
I got the 2.2 s with version 0.6, with version 0.5 it took 2.8 s, so
this is quite an improvement. Nevertheless it is still 20 times slower
than using synchronized. What is the reason? Do you think that were
will be better performance in later releases?
Anyhow I think you work is really interesting.
Regards,
Thomas