Boost logo

Boost Users :

From: Gottlob Frege (gottlobfrege_at_[hidden])
Date: 2007-02-28 16:14:19


On 2/28/07, Frank Mori Hess <frank.hess_at_[hidden]> wrote:
>
> It seems that now that we drop locks before running slots, we can get by
> with using boost/detail/lightweight_mutex.hpp for our mutex. Since it is
> header-only, and apparently compiles to a null mutex if the compiler is in
> single-threaded mode, I don't see much need for a ThreadingModel template
> parameter on the signal class any more. I'm dropping it from
> thread_safe_signals.
>

What if I want to use a single-threaded signal in a multi-threaded
program? ie some of my signals are multi-threaded, but I also have
some signals (for UI updates?) that will only ever be on the main/UI
thread.

In my coding, I'd probably not care about the mutex overhead, but some
might. I would tend to use the multi-threaded signals just in case
someone starts calling it from multiple threads later. But for UI
code (where, on Windows at least, it needs to be in a single thread)
maybe having the single-threadedness explicit would be worthwhile (to
help point out to future coders that singlethreadedness is a
requirement).

 Tony


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net