Difference between revisions of "Uno/Spec/Thread Unsafety Bridge"

From Apache OpenOffice Wiki
< Uno‎ | Spec
Jump to: navigation, search
m (Feature: Rephrased.)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
state:   draft          <br>
+
Type: Specification State: stable
type:    specification <br>
+
  
== Thread Unsafety Bridge ==
+
==Feature==
 +
This [[../Bridge|bridge]] protects [[Uno/Term/Thread Unsafe|thread-unsafe]] objects from being called by multiple threads in parallel.
  
=== Feature ===
+
Only one thread at a time can enter a [[Uno/Term/Thread Unsafe|thread-unsafe]] environment, a [[Uno/Term/Thread Unsafe|thread-unsafe]] environment is entered, if any thread has one of the methods provided by the <code>Enterable</code> API on the stack.
This [[../Bridge|bridge]] protects [[Uno/Term/Thread Unsafe|thread unsafe]] objects from being called by multiple threads concurrently. It does this by acquring a dedicated mutex before actually doing the call.
+
  
The purpose bridges behaves as follows,
+
==API==
* entering the Unsafety Environment aquires the associated mutex, in case the mutex has already been acquired, the calling thread blocks until it has been released,
+
Environment purpose named <code>":unsafe"</code>.
* leaveing the Unsafety Environment releases the associated mutex,
+
* calling into the Unsafey Environment, leads to the invocation of the passed function, after acquiring the associated mutex,
+
* calling out of the Unsafety Environment, leads to the invocation of the passed function, actually keeping the associated mutex acquired, therefor protecting any objects on the callers stack.
+
  
=== Rationale ===
+
==Dependencies==
 
+
=== API ===
+
[[../Purpose Bridge|Purpose bridge]] named <code>":unsafe"</code>.
+
 
+
=== Dependencies ===
+
 
* [[../Environment Stack]]
 
* [[../Environment Stack]]
  
  
 +
[[Category:Draft]]
 +
[[Category:Spec]]
 +
[[Category:Uno]]
 
[[Category:Uno:Spec]]
 
[[Category:Uno:Spec]]
 +
[[Category:Multi-Threading]]

Latest revision as of 07:23, 19 June 2007

Type: Specification State: stable

Feature

This bridge protects thread-unsafe objects from being called by multiple threads in parallel.

Only one thread at a time can enter a thread-unsafe environment, a thread-unsafe environment is entered, if any thread has one of the methods provided by the Enterable API on the stack.

API

Environment purpose named ":unsafe".

Dependencies

Personal tools