The framework itself is designed to work in a multi-threaded environment, and it makes sure that critical sections accessing shared variables are correctly handled (such as when the module Database provides or updates the globally cached database snapshots).
However, the EditingContext itself is not MT-safe by default. If your application requires that an EditingContext is concurrently accessed by different threads, you have to make sure that you lock it before use (e.g., before saving changes); methods lock() and unlock() are provided for that purpose. Typical usage follows:
try: ec.lock() ec.saveChanges() finally: ec.unlock()
Last, two nested EditingContext which have the same parent and are managed by two different threads can concurrently save their changes to their parent without explictly locking it -this is managed automatically. This is worth noting, even if this is logical since the framework is supposed to ensure that any operations made on an EditingContext is safe in a multi-threaded environment (given that the EditingContext is not shared between threads, obviously).
Comments are welcome: Sebastien Bigaret / Modeling Home Page