[Libreoffice] Thread Safety
kyoshida at novell.com
Tue Apr 26 11:57:58 PDT 2011
On Tue, 2011-04-26 at 20:47 +0200, Thorsten Behrens wrote:
> Rafael Dominguez wrote:
> > [...] so my question is should the ref count be thread safe or
> > not?
> Yes, it'll have to. LibO core objects tend to get used from
> different threads simultaneously - at least it's truly hard to
> verify they're not.
Well, do *all* ref-counted objects have to be thread-safe though?
Making stuff thread-safe comes with an overhead, and in some code
thread-safety isn't really guaranteed, like Calc core. We currently
require the caller to ensure that multiple threads aren't accessing the
core implementation, which basically translates to a bunch of solar
mutex objects in the UNO API implementations...
So, when we are implementing ref-counted objects in such code, I'd like
not to have the overhead of thread safety.
Kohei Yoshida, LibreOffice hacker, Calc
<kyoshida at novell.com>
More information about the LibreOffice