Difference between revisions of "Uno/Spec/Thread Affinity Bridge"
m (changed state.) |
m (fixed links.) |
||
| Line 3: | Line 3: | ||
== Thread Affinity Bridge == | == Thread Affinity Bridge == | ||
| − | A [[../Purpose Bridge|Purpose Bridge]] protecting [[ | + | A [[../Purpose Bridge|Purpose Bridge]] protecting [[Uno/Term/Thread Affine|Thread Affine]] objects. |
===Feature=== | ===Feature=== | ||
| − | The Thread Affinity Bridge ensures that encapsulated objects are always called by the same thread, thus compensating any [[ | + | The Thread Affinity Bridge ensures that encapsulated objects are always called by the same thread, thus compensating any [[Uno/Term/Thread Affine|thread affinity]]. The Affinity Bridge also ensures, that calls into or through it do not show any [[Uno/Term/Thread Aware|thread awareness]]. |
Only one thread at a time can enter a Affinity Environment, an Affinity Environment is entered, if any thread has one of the methods provided by the <code>Enterable</code> API on the stack. | Only one thread at a time can enter a Affinity Environment, an Affinity Environment is entered, if any thread has one of the methods provided by the <code>Enterable</code> API on the stack. | ||
=== Rationale === | === Rationale === | ||
| − | Some APIs have [[ | + | Some APIs have [[Uno/Term/Thread Affine|thread affinities]] in respect to particular handles they return. For example, on Win32 the window-destroy and -message functions require to be called by the same thread which actually created the window. This thread affinity is inherited when developing APIs on top of these thread affine APIs. |
In general, thread affine APIs are hard to program, especially in generic frameworks where it is not knowable before hand how long a thread lives and on whichs objects it calls. | In general, thread affine APIs are hard to program, especially in generic frameworks where it is not knowable before hand how long a thread lives and on whichs objects it calls. | ||
Revision as of 08:44, 10 July 2006
state: stable
type: specification
Thread Affinity Bridge
A Purpose Bridge protecting Thread Affine objects.
Feature
The Thread Affinity Bridge ensures that encapsulated objects are always called by the same thread, thus compensating any thread affinity. The Affinity Bridge also ensures, that calls into or through it do not show any thread awareness.
Only one thread at a time can enter a Affinity Environment, an Affinity Environment is entered, if any thread has one of the methods provided by the Enterable API on the stack.
Rationale
Some APIs have thread affinities in respect to particular handles they return. For example, on Win32 the window-destroy and -message functions require to be called by the same thread which actually created the window. This thread affinity is inherited when developing APIs on top of these thread affine APIs. In general, thread affine APIs are hard to program, especially in generic frameworks where it is not knowable before hand how long a thread lives and on whichs objects it calls.
API
A purpose bridge named "affine".