11 Objects and Concurrency As we have seen, objects in Oz are stateful data structures. Threads are the active computation entities.
Threads can communicate either by message passing using ports, or through common shared objects.
Communication through shared objects requires the ability to serialize concurrent operations on objects so that the object state is kept coherent after each such an operation. In Oz, we separate the issue of acquiring exclusive access of an object from the object system. This gives us the ability to perform coarse-grain atomic operation on a set of objects, a very important requirement, e.g. in distributed database systems. The basic mechanism in Oz to get exclusive access is through locks. The purpose of a lock is to mediate exclusive access to a shared resource between threads.