Uno/Spec/Threading-Model
From Apache OpenOffice Wiki
version: 12555
state: draft
type: specification
UNO Threading Model
- Feature
- The UNO Runtime provides support for implementing
- Thread Free, or
- Thread Safe, or
- Thread Unsafe, or
- Thread Affine
- Code.
- The threading type of any code can be specified appropriately. The Thread Unsafe type is the default type for any implementation.
- Rationale
- API
- Purpose Environment
- The different threading types are supported by using Purpose Environments.
- Implementation Environment
- The actual threading type can be selected in a Language Binding typical way and is backed by the appropriate Purpose Bridge. The used Purpose Bridges are the
- Thread Unsafety Bridge for Thread Unsafe code and the
- Thread Affinty Bridge for Thread Affine code. Thread Safe code does not need to be backed, as this is the default for plain code, these also preserves compatibility with previous UNO versions.
- Code may as well be declared Thread Free, so that it may be used from any other kind of code.
- Environment Stack
- The current (purpose) environment does not only vary with the implementation language (e.g. Java or C++), but also with the executed codes declared threading type. An API for accessing the current environment is provided.
- Cascaded Mapping
- Purpose environments may be passed to the Runtime for accessing cascaded mappings (
"gcc3"
=>"java:unsafe:debug"
).