Skip navigation

After fixing a self-assignment blunder in basegfx/source/matrix/b2dhommatrix.cxx, which happened in the copy-on-write-related parts of operator=, I began to wonder why on earth everybody and his grandma was doing cow (copy-on-write) by hand (a search for mnRefCount and m_nRefCount (though certainly only a subset) should give you an idea how abundant this theme is. BTW: I generally agree with Herb Sutter, that cow has disadvantages in a multi-threaded world — but, alas, giant objects like bitmaps or polygons should better still provide a cow implementation in the back).

So, I dug at the usual places, and in the corners of boost and ASL, I indeed found a cow_ptr and a copy_on_write wrapper. Nice. Only that I found cow_ptr too ambitious (all the cloning stuff should be irrelevant for OOo’s cow usage), and copy_on_write lacked some of boost::shared_ptr commodities I got used to (checked_delete, glue for boost::mem_fn, operator forwarding, standard-compatible swap, you get the idea).

Consequently, I cobbled together a cow_wrapper, tailored to the usual, pimpled use of cow in OOo:

class Impl;

class MyClass
{
public:
   MyClass();

   void set( int v );
   int  get() const;

private:
   cow_wrapper mpImpl;
};

where the get() and set() methods simply forward to the Impl methods:

void MyClass::set( int v )
{
    mpImpl->set(v);
}
int MyClass::get() const
{
    return mpImpl->get();
}

And the trick is: cow_wrapper has operator-> overloaded for const and non-const access. For non-const access, the potentially shared copy of the Impl object gets copied (i.e. made unique).

Except that cow_wrapper doesn’t yet have all wanted features (checked_delete support still missing), and possibly needs some testing, I think this holds up for quite painless cow implementations (yes, I intend to move at least basegfx to cow_wrapper, eventually).

While debugging an especially insidious slideshow jerkiness (which only manifests itself on a single type of Toshiba laptop, and only with the most recent JDS builds — i.e. prolly exposed by that particular combination of NVidia chip and Xorg nv driver), I found relief (and distraction) in reading one of ESR’s inspiring texts: The Tao of Unix Programming (Chapter 1 — Philosophy got me straightened out again).

Which in turn got me (somehow) looking for keithp’s article about X11 network performance, which in turn referenced xcap, which in turn pointed me to the thing that possibly goes wrong in the setup above: after every bitmap operation, OOo seems to scan the X11 queue for GraphicsExpose events, and generates paint events from that — even if there’s nothing that’s been exposed, or needs repaint. I guess that needs a change.

After quite some time & discussion, it appears that issue 12719 is finally getting somewhere (see the wiki-ized spec for even more details). David has started work on the VCL innards, to provide means to actually query and select a monitor to display a slideshow window.
Still, the hardest part (and the area where there’s the most to gain, productivity-wise) is the presenter view functionality in Impress (quickly navigating, previewing, even modifying slides) – any volunteers?

Coherent with all the CoolThreads and Eco computing fuzz, this amazing pun occurred to me today: The Sun powers my Sun running Sun Solaris – cute, ain’t it? And even more so, as both that old box and the new T1000 will probably be content with the ~100 Watts my solar generator was producing today (yeah, t’was a rather darkish winter day here in Hamburg) – the Niagara chip is purported to sip only ~70 Watts.

Had my datalogging facility from the solar step-up converter finished & connected today – unfortunately, the data aquisition software comes only for Windows. D’oh. But on the plus side of things is this: Fronius, the converter manufacturer, actually publish the protocol specs!

So, time for some low-level RS232 hacking! This has to work on my brave SparcStation10, being my home comms hub & usually up 24/7.

And on a related note: this is why I’m so in favor of Open Standards.

After some delays (a few parts for my switching cabinet were missing, and took quite some time to order – I’m always surprised how fast things are ‘discontinued’ from manufacturing), we’re now online with my photovoltaic generator!

Notwithstanding low sun and part of the solar modules in shadow, the generator produced an impressing ~1000 watts today at noon. Admittedly, it was a bright, sunny winter day in Hamburg, though.

So, things are mostly done there, with basically only the data logging facility missing (for which I’m really longing for – as it offers oh so many ways to script and analyze data).

Profiling a huge beast such as OpenOffice.org is clearly a stress for any tool – in this case, it blew the callgrind backend for the valgrind analysis framework. Valgrind seems to reserve a fixed amount of virtual mem for the actual program – if that gets exceeded, strange things will happen, in my case, debug symbols for my libs weren’t loaded (and, guess what, a profile with only hex function labels is kind of unhelpful).

What I finally made to work was the following setup:
callgrind-0.10.0 on top of valgrind-3.0.1, with the following two patches:

--- configure~	2005-08-30 03:15:16.000000000 +0200
+++ configure	2005-11-24 14:27:36.000000000 +0100
@@ -3991,7 +3991,7 @@
 	echo "$as_me:$LINENO: result: ok (${host_cpu})" >&5
 echo "${ECHO_T}ok (${host_cpu})" >&6
         VG_ARCH="x86"
-        KICKSTART_BASE="0xb0000000"
+        KICKSTART_BASE="0xa0000000"
         ARCH_CORE_AM_CFLAGS="@FLAG_M32@ @PREFERRED_STACK_BOUNDARY@"
         ARCH_TOOL_AM_CFLAGS="@FLAG_M32@ @PREFERRED_STACK_BOUNDARY@"
         ARCH_CORE_AM_CCASFLAGS="@FLAG_M32@"

(this one adds 256MB additional space for the program to be analyzed – thanks to Yuri’s mail)

and

--- main.c~	2005-10-04 01:28:01.000000000 +0200
+++ main.c	2005-11-24 13:46:13.000000000 +0100
@@ -274,7 +274,7 @@
    if (bb_seen_before) {
        CLG_ASSERT(ii->instr_offset == instr_offset);
        CLG_ASSERT(ii->instr_size == instrLen);
-       CLG_ASSERT(ii->data_size == dataSize);
+       //CLG_ASSERT(ii->data_size == dataSize);
        CLG_ASSERT(ii->cost_offset == *cost_offset);
        CLG_ASSERT(ii->eventset == es);
    }

(which silences an assertion – the error itself apparently did no harm, things went smoothly after that).

Today, the last solar modules were mounted, and we started with the wiring. There’s a total of 20 solar modules, divided up into 5 groups – i.e. four modules are connected in a row, and form a ‘string’, which are two cables individually connected to the DC/AC step-up converter. That’s a lot of wires, which had to be squeezed beneath roofing tiles, glass wool, and other obstacles.

Solar panels mounted

Anybody knew that electricity generated by photovoltaic cells (aka “solar cells”) can be passed into the power grid in Germany? In fact, the local grid company must accept it (and yes, even pay you for it, just the same as it pays the nuclear power plant next door).

Which is a nice thing indeed, as I’ve some square meters of my southwards roof to spend, plus some boxes sucking electricity 24/7 and gnawing at my conscience.

So I went for it, and construction started just yesterday – laying the grounds for a total of 3.1 kilowatts peak solar power.

Preparing roof mounts

After months of fixing and rework, a bulk of changes to OOo’s slideshow/canvas framework has hit CVS HEAD today. This started as a consolidation effort (collecting various bits and pieces, removing duplicate code, and doing something smart about sprite redraw), and ended in a bunch of important fixes (see canvas02 EIS entry for a list of issues).