octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thread-safety issues in QtHandles


From: Michael Goffioul
Subject: Re: Thread-safety issues in QtHandles
Date: Tue, 15 Nov 2011 10:12:57 +0000

On Tue, Nov 15, 2011 at 9:53 AM, Søren Hauberg <address@hidden> wrote:
> I just tried this on 32-bit Linux, and it works even though I see a
> noticeable slow-down. I tried running
>
>  clear; tic, N = 1000; for a = 1:N, for b = 1:N, A (a, b) = a; endfor,
> endfor; toc
>
> in Octave with thread-safety enabled and got a run-time of 12.3 seconds
> and without it drops to 8.8 seconds.

This is indeed a large slow-down, I'll test it on my platform as well,
for comparison. But this is also probably a worst-case scenario, where
A is constantly re-allocated; and octave is not known to be very
efficient on for-loops.

> I am very much in favour of making the Octave core thread-safe as it
> would be a first step in making parallel computations possible from
> within Octave. Yet it seems like the observed slow-down is too large at
> the moment. Do you have a feeling if the current implementation is as
> fast as it can get or if there are tricks to speed things up?

When compiled with all optimization and compiler intrinsics turned on,
the refcount increment boils down to "lock add" instruction. I think
that's the best you can do. If you have any better idea, please feel
free to experiment.

Michael.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]