- We design and build extraordinary applications for companies looking to make the next great idea a reality.
- learn more
JSTM for GWT: An Interesting Solution for Object Replication and Synchronization
Didier Girard, the peripatetic publisher of onGWT, read my post yesterday and pointed me toward XSTM, the open source OO distributed object cache. It has Java, .NET and GWT implementations that can interoperate.
Somehow I missed Dion's two mentions (here and here) of this library. I guess "object cache" didn't trigger the right response in my brain. When I hear cache, I think of something much simpler. Digging into the background of XSTM, we find that it has it's origins in Software Transactional Memory.
In computer science, software transactional memory (STM) is a concurrency control mechanism analogous to database transactions for controlling access to shared memory in concurrent computing. It functions as an alternative to lock-based synchronization, and is typically implemented in a lock-free way. A transaction in this context is a piece of code that executes a series of reads and writes to shared memory. These reads and writes logically occur at a single instant in time; intermediate states are not visible to other (successful) transactions.
Lots of high level, abstract talk, sure. What does this really mean? From the background page:
Think of this as source control for objects. Let's say threads are developers: Today's concurrent programs are like a team of developers working without source control! Those developers would need to cooperate continuously to not write to the same files at the same time, like in in a concurrent program each thread must take care of not modifying a variable used by another one.
By using a source control solution, each developer can work on his own private view of the source code. When he is done working on this private view, and when he has verified it is tested and correct, the developer can merge it to the shared one. Only then other developers will see the modifications, and they will appear all at once. This way the shared view always jumps from a correct state to another correct state. Transactions enable this model for in memory objects.
I, for one, can't wait to take this bad boy for a spin.
Technorati Tags: ajax, gwt, xstm, shared transactional memory
Comments: 2 so far
Leave a comment
About Pathfinder
Recent
- Faster JavaScript for Firefox 3.1 Thru JIT
- Implementing linked multiselects with jQuery, LiveQuery, and Low Pro: Part 2: First pass at the actual code
- I’m Cranky Because I’m Not Getting Enough REST
- Flex Gauge Component Example with source
- Plugging Some Cool Tools
- Implementing linked multiselects with jQuery, LiveQuery, and Low Pro: Part 1: Requirements and interaction design
- Many Varied Components, or… Multi Variable Complexity, or… Mainly Vanilla Coding
- Custom Flex 3 Lightweight Preloader with source code
- Mass Assigning Inheritance Column Values for ActiveRecord STI with Rails
- Working effectively as a team of one: Five tips for front-end developers on Agile teams
Archives
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006


How does solutions like XSTM stack up with memcacheD or Terracotta ? Do they address the same use cases ?
Comment by Debasish Ghosh, Sunday, April 20, 2008 @ 11:54 pm
Hello, thank you and Didier for this post! XSTM can be used for object caching like memcacheD or Terracotta but its more specific feature is client/server replication. E.g. to write a .NET or GWT UI for a Java server. Compared to Terracotta, XSTM is very similar but it uses optimistic locking (transactions) instead of pessimistic (distributed locks) and lacks some of their features like virtual heap, persistence etc…
Comment by Cyprien Noel, Monday, April 21, 2008 @ 5:50 am