Effort/Make VCL Thread-Transparent

From Apache OpenOffice Wiki
< Effort
Revision as of 12:18, 1 March 2006 by Kr (Talk | contribs)

Jump to: navigation, search

Making VCL Thread Transparent

[1], [2]

Status: in progress

changed: --Kr 12:37, 1 March 2006 (CET)


VCL, the OOo widget set and windowing abstraction, currently hampers thread transparency in the following ways:

  • It is thread affine under Windows - bascially letting shining through the Win32 thread affinity regarding event loops and window construction.
  • It provides the solar mutex, which needs to be acquired befor calling, but which also gets fully released in some situations.

VCL makes use of global variables, therefor only providing a single instance. VCLs internals are not protected against concurrent access, except by the SolarMutex, which needs to be locked from outside. VCLs API only provides blocking or polling functions for accessing the event loop. This is especially bad as it does not offer a way, to avoid long locked MutExes or polling, while waiting for events.

To make VCL thread transparent, we propose, to

  • remove the Solar Mutex and to replace it with another Mutex
  • Encapsulate calls to the thread affine Win32 API, in a way, that this thread affinity is not visible from the outside.

The goal being to have VCL just as a ordinary library, not showing any threading behavior by itself.


Tasks for VCL Thread Transparency
Title Spec  % Changed Impl  % Changed Test  % Changed
API for Accessing the status of the event loop 0.0 0% 12/14/2005 proof 0% 12/14/2005
Replace the SolarMutex 0.0 0% 12/14/2005 proof 0% 12/14/2005
Introduce dedicated Windows Thread 0.0 0% 12/14/2005 proof 0% 12/14/2005
Delegate Msg oriented calls into Windows Thread 0.0 0% 02/22/2006 proof 0% 02/22/2006

Some Win32 based OOo components expect the initialising thread eventually to enter the VCL event loop, dispatching messages for objects created during this initialization. These implementations need to be adapted, to either delegate Win32 thread affine calls into VCLs new internal thread, or to create a thread for dispatching purposes by their own.

The above tasks are going to depend on the Extended UNO Threading Framework, therefor VCL Thread Transparency will earliest be available after the UTF.

Personal tools