Difference between revisions of "Effort/Implement Basic Threading-Architecture"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Added module "graphics/goodies".)
m (Dependencies: Fixed title layout ...)
 
(29 intermediate revisions by the same user not shown)
Line 1: Line 1:
Status: in progress
+
Type: Effort  Status: in progress
  
; Specification:
+
The OOo [[Uno/Term/Threading-Architecture|threading-architecture]] is going to be well defined, many little changes need to be done to get implemented what is specified as the [[Spec/Threading-Architecture|threading-architecture]].
: [[Spec/Architecture/Threading/Basic|Basic Threading Architecture]]
+
  
; Changes - Convert Office Modules to be Thread unsafe:
+
==Problem==
:* [http://util.openoffice.org/source/browse/util/comphelper/ module util/comphelper]:  
+
The biggest problem is the size of the code base. It is hard to actually get an overview where thread related constructs are used. Typical usages are:
:** AsyncNotifier / ImplHelper / EventNotifierImpl - adapt to be usable by multiple threads.
+
* use a mutex to protect an object,
:** Declare exported services as "thread unsafe":
+
* use a thread to do something in the background,
:*** "IndexedPropertyValuesContainer"
+
* use a thread to encapsulate thread affinities (e.g. in dtrans).
:*** "NamedPropertyValuesContainer"
+
Some usages are more implicit:
:*** "AnyCompareFactory"
+
* post a user message into the [[VCL]] event queue, to delegate the execution of a particular operation into the "main" thread,
:*** "com.sun.star.comp.util.OfficeInstallationDirectories"
+
* use the "global" mutex to do some initialization,
:* [http://dba.openoffice.org/source/browse/dba/connectivity/ module dba/connectivity]:
+
* use the [[Terms/Solar Mutex|Solar Mutex]] to protect a particular object,
:** Make ZConnectionPool / OPoolTimer thread enter the default thread unsafe environment before invalidating the pooled connections.
+
* rely on [[VCL]]:Win32 to enter the <code>getMessage</code> loop in the main thread (DDE).
:** Declare exported services as "thread unsafe":
+
 
:*** "com.sun.star.sdbc.OConnectionPool"
+
==Solution==
:*** "com.sun.star.comp.sdbcx.adabas.ODriver"
+
Actually grep for thread related [[Uno]] code and change it, if needed. Change the environments of all possible components to <code>"c++:unsafe"</code>.
:*** "com.sun.star.comp.sdbc.ado.ODriver"
+
 
:*** "com.sun.star.comp.sdbc.calc.ODriver"
+
===Threads===
:*** "com.sun.star.comp.sdbc.dbase.ODriver"
+
* vos timer thread
:*** Evoab - "com.sun.star.comp.sdbc.evoab.OEvoabDriver"
+
* dtrans threads (clipboard and D&D)
:*** Evoab2 - "com.sun.star.comp.sdbc.evoab.OEvoabDriver"
+
* ucbhelper: background download thread
:*** "com.sun.star.sdbc.driver.file.Driver"
+
* ICE thread
:*** "com.sun.star.comp.sdbc.flat.ODriver"
+
* configuration flash thread
:*** "com.sun.star.sdbcx.comp.hsqldb.Driver"
+
* Win32: affinity thread
:*** "com.sun.star.comp.sdbc.JDBCDriver"
+
* office acceptor thread - second process thread
:*** "com.sun.star.comp.sdbc.MozabDriver"
+
* Uno acceptor thread
:*** "com.sun.star.sdbc.OSDBCDriverManager"
+
* io - pump thread
:*** "com.sun.star.comp.sdbc.ParameterSubstitution"
+
* package manager deployment GUI thread
:* [http://framework.openoffice.org/source/browse/framework/desktop module framework/desktop]:
+
* Uno job threads
:* [http://util.openoffice.org/source/browse/util/extensions module util/extensions]:
+
* Printer discovery
:** Declare exported services as "thread unsafe":
+
 
:*** "org.openoffice.comp.abp.OAddressBookSourcePilot"
+
===Components===
:*** "com.sun.star.extensions.Bibliography"
+
 
:*** "com.sun.star.comp.configuration.backend.LdapUserProfileBe"
+
===Libraries===
:*** "org.openoffice.comp.dbp.OGroupBoxWizard"
+
 
:*** "com.sun.star.installation.ProtCheck.V10"
+
===Applications===
:*** "com.sun.star.comp.ole.OleClient"
+
 
:*** "com.sun.star.extensions.Archiver"
+
==Tasks==
:*** "com.sun.star.extensions.PluginManager"
+
{|border="1" cellspacing="0" class="wikitable"
:*** "org.openoffice.comp.preload.OEMPreloadWizard"
+
|- style="background:#efefef;"  
:*** "org.openoffice.comp.form.ui.OControlFontDialog"
+
! Title !! State
:*** "com.sun.star.comp.extensions.ResourceService"
+
|-
:*** "com.sun.star.scanner.ScannerManager"
+
| Declare be [[Uno/Term/Thread Unsafe|thread-unsafe]] [http://framework.openoffice.org/source/browse/framework/desktop module framework/desktop] || UTF2
:*** "com.sun.star.comp.extensions.SVGWriter"
+
|-
:*** "com.sun.star.comp.extensions.SVGPrinter"
+
| Declare be [[Uno/Term/Thread Unsafe|thread-unsafe]] [http://framework.openoffice.org/source/browse/framework/sfx2 module framework/sfx2] || UTF2
:*** "com.sun.star.comp.io.XMLExtractor"
+
|-
:*** "oletest.OleTestImpl"
+
| Declare be [[Uno/Term/Thread Unsafe|thread-unsafe]] [http://framework.openoffice.org/source/browse/framework/filter module framework/filter] || UTF2
:* [http://util.openoffice.org/source/browse/util/fileaccess module util/fileaccess]:
+
|-
:** Declare exported services as "thread unsafe":
+
| Declare be [[Uno/Term/Thread Unsafe|thread-unsafe]] [http://graphics.openoffice.org/source/browse/graphics/goodies module graphics/goodies] || UTF2
:*** "com.sun.star.comp.ucb.SimpleFileAccess"
+
|-
:* [http://framework.openoffice.org/source/browse/framework/filter module framework/filter]:
+
| Declare be [[Uno/Term/Thread Unsafe|thread-unsafe]] [http://graphics.openoffice.org/source/browse/graphics/svx module graphics/svx] || UTF2
:** Declare exported services as "thread unsafe":
+
|-
:*** "com.sun.star.comp.filter.config.ConfigFlush"
+
| Declare be [[Uno/Term/Thread Unsafe|thread-unsafe]] [http://gsl.openoffice.org/source/browse/gsl/toolkit module gsl/toolkit] || UTF2
:*** "com.sun.star.comp.filter.config.ContentHandlerFactory"
+
|-
:*** "com.sun.star.comp.filter.config.FilterFactory"
+
| Declare be [[Uno/Term/Thread Unsafe|thread-unsafe]] [http://l10n.openoffice.org/source/browse/l10n/i18npool module l10n/i18npool] || UTF2
:*** "com.sun.star.comp.filter.config.FrameLoaderFactory"
+
|-
:*** "com.sun.star.comp.filter.config.TypeDetection"
+
| Declare be [[Uno/Term/Thread Unsafe|thread-unsafe]] [http://sw.openoffice.org/source/browse/sw/linguistic module sw/linguistic] || UTF2
:*** "com.sun.star.util.FilterTracer"
+
|-
:*** "com.sun.star.comp.Impress.FlashExportFilter"
+
| Declare be [[Uno/Term/Thread Unsafe|thread-unsafe]] [http://sw.openoffice.org/source/browse/sw/sw module sw/sw] || UTF2
:*** "com.sun.star.comp.Impress.FlashExportFilter"
+
|-
:*** "com.sun.star.presentation.PptImporter"
+
| Declare be [[Uno/Term/Thread Unsafe|thread-unsafe]] [http://ucb.openoffice.org/source/browse/ucb/uui module ucb/uui] || UTF2
:*** "com.sun.star.comp.PDF.PDFDialog"
+
|-
:*** "com.sun.star.comp.PDF.PDFFilter"
+
| Declare be [[Uno/Term/Thread Unsafe|thread-unsafe]] [http://util.openoffice.org/source/browse/util/comphelper/ module util/comphelper] || UTF2
:*** "com.sun.star.comp.Impress.PlaceWareExportFilter"
+
|-
:*** "com.sun.star.comp.Draw.SVGFilter"
+
| Declare be [[Uno/Term/Thread Unsafe|thread-unsafe]] [http://util.openoffice.org/source/browse/util/xmlhelp module util/xmlhelp] || UTF2
:*** "com.sun.star.comp.Writer.XmlFilterAdaptor"
+
|-
:*** "com.sun.star.comp.filters.XMLFilterDetect"
+
| Declare be [[Uno/Term/Thread Unsafe|thread-unsafe]] [http://util.openoffice.org/source/browse/util/unotools module util/unotools] || UTF2
:*** "XMLFilterDialogComponent"
+
|-
:*** "com.sun.star.comp.documentconversion.XSLTFilter"
+
| Declare be [[Uno/Term/Thread Unsafe|thread-unsafe]] [http://util.openoffice.org/source/browse/util/svtools module util/svtools] || UTF2
:* [http://graphics.openoffice.org/source/browse/graphics/goodies module graphics/goodies]:
+
|-
:** Declare exported services as "thread unsafe":
+
| Declare be [[Uno/Term/Thread Unsafe|thread-unsafe]] [http://util.openoffice.org/source/browse/util/extensions module util/extensions] || UTF2
:*** "com.sun.star.comp.graphic.GraphicDescriptor"
+
|-
:*** "com.sun.star.comp.graphic.Graphic"
+
| Declare be [[Uno/Term/Thread Unsafe|thread-unsafe]] [http://util.openoffice.org/source/browse/util/fileaccess module util/fileaccess] || UTF2
:*** "com.sun.star.comp.graphic.GraphicProvider"
+
|-
:*** "com.sun.star.comp.graphic.GraphicRendererVCL"
+
| Declare be [[Uno/Term/Thread Unsafe|thread-unsafe]] [http://xml.openoffice.org/source/browse/xml/xmloff module xml/xmloff] || UTF2
 +
|-
 +
| Declare be [[Uno/Term/Thread Unsafe|thread-unsafe]] [http://xml.openoffice.org/source/browse/xml/package module xml/package] || UTF2
 +
|-
 +
| Declare be [[Uno/Term/Thread Unsafe|thread-unsafe]] [http://xml.openoffice.org/source/browse/xml/sax module xml/sax] || UTF2
 +
|-
 +
| Declare be [[Uno/Term/Thread Unsafe|thread-unsafe]] [http://dba.openoffice.org/source/browse/dba/connectivity/ module dba/connectivity] || UTF2
 +
|-
 +
| Make ZConnectionPool / OPoolTimer thread enter the default [[Uno/Term/Thread Unsafe|thread-unsafe]] environment before invalidating the pooled connections. || UTF2
 +
|-
 +
| AsyncEventNotifier / EventNotifierImpl - Already call "getComponent" at the "IEventProcessor" during construction of the "AsyncEventNotifier" and remember the object in a "free" reference || utf2
 +
|-
 +
| [[Effort/Make VCL Thread-Transparent]] || in progress
 +
|-
 +
|}
 +
 
 +
==Dependencies==
 +
{|border="1" cellspacing="0" class="wikitable"
 +
|- style="background:#efefef;"  
 +
! Area !! Title !! State !! [[CWS]]
 +
|-
 +
| [[Uno/Cpp|C++ Uno]] || [[Uno/Effort/Binary/Extend_Threading-Model|Extended Binary Uno Threading-Model]] || style="background:lightgreen;"|ready for QA || {{Uno/CWS|SRC680|bunoexttm}}
 +
|-
 +
| [[VCL]] || [[Effort/Make_VCL_Thread-Transparent|Thread-Transparent VCL]] || style="background:yellow;"|in progress || {{Uno/CWS|SRC680|vclthreadtransparency1}}<br>{{Uno/CWS|SRC680|vclthreadtransparency2}}
 +
|}
  
; Dependencies:
 
:* [[Effort/Making_VCL_Thread_Transparent|Make VCL Thread Transparent]]
 
:* [[Effort/Make DDE Thread Transparent|Make DDE Thread Transparent]]
 
:* [[Effort/Make D&D Thread Transparent|Make D&D Thread Transparent]]
 
:* [[Effort/Make Clipboard Thread Transparent|Make Clipboard Thread Transparent]]
 
  
 
[[Category:Effort]]
 
[[Category:Effort]]
 +
[[Category:Architecture]]
 +
[[Category:Multi-Threading]]

Latest revision as of 14:07, 13 July 2007

Type: Effort Status: in progress

The OOo threading-architecture is going to be well defined, many little changes need to be done to get implemented what is specified as the threading-architecture.

Problem

The biggest problem is the size of the code base. It is hard to actually get an overview where thread related constructs are used. Typical usages are:

  • use a mutex to protect an object,
  • use a thread to do something in the background,
  • use a thread to encapsulate thread affinities (e.g. in dtrans).

Some usages are more implicit:

  • post a user message into the VCL event queue, to delegate the execution of a particular operation into the "main" thread,
  • use the "global" mutex to do some initialization,
  • use the Solar Mutex to protect a particular object,
  • rely on VCL:Win32 to enter the getMessage loop in the main thread (DDE).

Solution

Actually grep for thread related Uno code and change it, if needed. Change the environments of all possible components to "c++:unsafe".

Threads

  • vos timer thread
  • dtrans threads (clipboard and D&D)
  • ucbhelper: background download thread
  • ICE thread
  • configuration flash thread
  • Win32: affinity thread
  • office acceptor thread - second process thread
  • Uno acceptor thread
  • io - pump thread
  • package manager deployment GUI thread
  • Uno job threads
  • Printer discovery

Components

Libraries

Applications

Tasks

Title State
Declare be thread-unsafe module framework/desktop UTF2
Declare be thread-unsafe module framework/sfx2 UTF2
Declare be thread-unsafe module framework/filter UTF2
Declare be thread-unsafe module graphics/goodies UTF2
Declare be thread-unsafe module graphics/svx UTF2
Declare be thread-unsafe module gsl/toolkit UTF2
Declare be thread-unsafe module l10n/i18npool UTF2
Declare be thread-unsafe module sw/linguistic UTF2
Declare be thread-unsafe module sw/sw UTF2
Declare be thread-unsafe module ucb/uui UTF2
Declare be thread-unsafe module util/comphelper UTF2
Declare be thread-unsafe module util/xmlhelp UTF2
Declare be thread-unsafe module util/unotools UTF2
Declare be thread-unsafe module util/svtools UTF2
Declare be thread-unsafe module util/extensions UTF2
Declare be thread-unsafe module util/fileaccess UTF2
Declare be thread-unsafe module xml/xmloff UTF2
Declare be thread-unsafe module xml/package UTF2
Declare be thread-unsafe module xml/sax UTF2
Declare be thread-unsafe module dba/connectivity UTF2
Make ZConnectionPool / OPoolTimer thread enter the default thread-unsafe environment before invalidating the pooled connections. UTF2
AsyncEventNotifier / EventNotifierImpl - Already call "getComponent" at the "IEventProcessor" during construction of the "AsyncEventNotifier" and remember the object in a "free" reference utf2
Effort/Make VCL Thread-Transparent in progress

Dependencies

Area Title State CWS
C++ Uno Extended Binary Uno Threading-Model ready for QA bunoexttm
VCL Thread-Transparent VCL in progress vclthreadtransparency1
vclthreadtransparency2
Personal tools