POV-Ray : Newsgroups : povray.beta-test : Radiosity: status & SMP idea : Re: Radiosity: status & SMP idea Server Time
28 Jul 2024 20:35:27 EDT (-0400)
  Re: Radiosity: status & SMP idea  
From: Warp
Date: 22 Dec 2008 08:22:52
Message: <494f94ac@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
> Warp wrote:
> >   As a curiosity, I tested the actual slowdown caused by Boost mutexes.

> Sorry, but this is a fairly baseless claim because there are no "Boost" 
> mutexes. Boost provides nothing more than a very low-overhead (zero overhead 
> if using an optimizing compiler) wrapper over Posix mutexes on Unix and 
> Win32 mutexes on Windows. As such, "Boost mutexes" cannot be slower than the 
> native operating system's mutexes because they *are* nothing more than the 
> native operating system's mutexes!

  One would think so, but one would be wrong.

  If in the example program I mentioned I change the Boost mutex to a
Pthreads mutex, the running time of the program decreases from 47 seconds
to 41 seconds. I measured both versions several times, and the times were
completely consistent, with negligible variation (in the order of plus/minus
0.1 seconds).

  The difference is small, but it exists. The "thin" wrapper in Boost does
cause its small overhead.

  (I read somewhere that newer versions of Boost fix this small problem
by resorting to more inlining. It might be that I have a version of boost
which does not inline as much.)

  OpenMP mutexes are slightly faster than Pthreads mutexes, at least here.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.