Difference between revisions of "Uno/Binary/Spec/Threading-Model"

From Apache OpenOffice Wiki
< Uno‎ | Binary
Jump to: navigation, search
(Moved from udk.openoffice.org)
 
(reworked:)
Line 3: Line 3:
 
state:  draft          <br>
 
state:  draft          <br>
 
created: 01/10/2006    <br>
 
created: 01/10/2006    <br>
changed: 01/10/2006    <br>
+
changed: 03/06/2006    <br>
 
type:    specification  <br>
 
type:    specification  <br>
  
Line 9: Line 9:
 
=== Threading Model ===
 
=== Threading Model ===
  
;Goal: Integrate threading models into the Binary UNO runtime.
+
;Feature
 
+
: UNO Threading Model for the Binary UNO runtime.
;Feature A
+
 
: Support thread model specific compilation. The following new defines select the UNO threading model for binary UNO:
 
: Support thread model specific compilation. The following new defines select the UNO threading model for binary UNO:
* CPPU_THREAD_SAFE
+
: * <code>UNO_THREAD_SAFE</code>
* CPPU_THREAD_UNSAFE
+
: * <code>UNO_THREAD_UNSAFE</code>
* CPPU_THREAD_AFFINE
+
: * <code>UNO_THREAD_AFFINE</code>
 
+
Services / Client code compiled with one of these defines lifes in the
+
associated environment. Not defining one of these defines, lets binary UNO fall back
+
to CPPU_THREAD_SAFE, and gives a warning. This is compatible with the original behaviour.
+
 
+
Associated environments are:
+
* CPPU_THREAD_SAFE  => <BU-LB>[:null]
+
* CPPU_THREAD_UNSAFE => <BU-LB>:mutex
+
* CPPU_THREAD_AFFINE => <BU-LB>:thread
+
  
(<BU-LB> stands for any binary UNO language binding (e.g. various C/C++))
+
: Services / Client code compiled with one of these defines lifes in the associated environment. Not defining one of these defines, lets binary UNO fall back to <code>CPPU_THREAD_SAFE</code>, and gives a warning. This is compatible with the original behaviour.
  
 +
: Associated environments are:
 +
: * <code>UNO_THREAD_SAFE  </code> => <code>"<ABI>"</code>
 +
: * <code>UNO_THREAD_UNSAFE</code> => <code>"<ABI>:mutex"</code>
 +
: * <code>UNO_THREAD_AFFINE</code> => <code>"<ABI>:thread"</code>
  
Purpose Environments
+
: Threading model specific environments are backed by the appropriate purpose environments.
Threading model specific environments are backed by the appropriate purpose environments.
+
: * <code>"<ABI>:mutex" </code> is backed by the default mutex environment
* <BU-LB>:mutex environments are backed by the default mutex apartment
+
: * <code>"<ABI>"      </code> is backed by the default free environment (as usual)
* <BU-LB>[:null] environments are backed by the default free apartment
+
: * <code>"<ABI>:thread"</code> is backed by the default thread environment
* <BU-LB>:thread environments are backed by the default thread apartment
+
  
Feature:  
+
: The UNO Threading Model specification for Binary UNO is the sum of the specifications for the parts, see below for details.
* Environment Guards
+
* Environment Aware References
+
* Environment Stacks
+
* Cascaded Mappings
+
* Purpose Environments
+
  
Dependencies:
+
; Rationale
* Environment Guards
+
: The current threading related code quality of OOo has proven, the doing proper multi threading programming is not easy. Even seemingly simple things, as thread safeness, seem to be unreachable. Therefor UNO programming must be as simple as possible in respect to multi threading programming.
* Environment Aware References
+
* Environment Stacks
+
* Cascaded Mappings
+
* Purpose Environments
+
  
Changes:
+
; API Extensions:
* Environment Guards
+
: * Environment Guards
* Environment Aware References
+
: * Environment Aware References
* Environment Stacks
+
: * Environment Stacks
* Cascaded Mappings
+
: * Cascaded Mappings
* Purpose Environments
+
: * Purpose Environments
  
API Extensions:
+
; Dependencies
* Environment Guards
+
: * Environment Guards
* Environment Aware References
+
: * Environment Aware References
* Environment Stacks
+
: * Environment Stacks
* Cascaded Mappings
+
: * Cascaded Mappings
* Purpose Environments
+
: * Purpose Environments
  
Compatibility Issues:
+
; Compatibility Issues:
* Environment Guards
+
: * Environment Guards
* Environment Aware References
+
: * Environment Aware References
* Environment Stacks
+
: * Environment Stacks
* Cascaded Mappings
+
: * Cascaded Mappings
* Purpose Environments
+
: * Purpose Environments

Revision as of 10:25, 6 March 2006

author: Kr
version: 5792
state: draft
created: 01/10/2006
changed: 03/06/2006
type: specification

Binary UNO

Threading Model

Feature
UNO Threading Model for the Binary UNO runtime.
Support thread model specific compilation. The following new defines select the UNO threading model for binary UNO:
* UNO_THREAD_SAFE
* UNO_THREAD_UNSAFE
* UNO_THREAD_AFFINE
Services / Client code compiled with one of these defines lifes in the associated environment. Not defining one of these defines, lets binary UNO fall back to CPPU_THREAD_SAFE, and gives a warning. This is compatible with the original behaviour.
Associated environments are:
* UNO_THREAD_SAFE => "<ABI>"
* UNO_THREAD_UNSAFE => "<ABI>:mutex"
* UNO_THREAD_AFFINE => "<ABI>:thread"
Threading model specific environments are backed by the appropriate purpose environments.
* "<ABI>:mutex" is backed by the default mutex environment
* "<ABI>" is backed by the default free environment (as usual)
* "<ABI>:thread" is backed by the default thread environment
The UNO Threading Model specification for Binary UNO is the sum of the specifications for the parts, see below for details.
Rationale
The current threading related code quality of OOo has proven, the doing proper multi threading programming is not easy. Even seemingly simple things, as thread safeness, seem to be unreachable. Therefor UNO programming must be as simple as possible in respect to multi threading programming.
API Extensions
* Environment Guards
* Environment Aware References
* Environment Stacks
* Cascaded Mappings
* Purpose Environments
Dependencies
* Environment Guards
* Environment Aware References
* Environment Stacks
* Cascaded Mappings
* Purpose Environments
Compatibility Issues
* Environment Guards
* Environment Aware References
* Environment Stacks
* Cascaded Mappings
* Purpose Environments
Personal tools