Download JavaSpaces in Practice by Phillip Bishop, Nigel Warren PDF
56 Part I: Entries Part I: Entries 57 Looking at the above XML code, you can see that "A.
In a non-space-based Java program, we could represent a simple XML document by a single class, such as the XMLNode class shown below.
Pop 1. Create a Transaction. 2. Take the ArrayMetaData. 3. Get the tail index. 4. Take the tail element. 5. Decrement the tail index. 6. Write the ArrayMetaData back to the space. 7. Commit the Transaction. Improving the design We have seen how to use a distributed array as a building block for other ordered data structures such as queues and stacks by manipulating an entry that contains metadata about the start and end indexes. This is fine, but it could result in a problem. This is to do with the lock (take) contention, when one process wants to take something from the array and another process wants to add something to the array the operations are mutually exclusive, as each process needs to take the ArrayMetaData entry before proceeding.