Boost logo

Boost Users :

Subject: Re: [Boost-users] [MSM] state transitions and exceptions
From: Christophe Henry (christophe.j.henry_at_[hidden])
Date: 2012-04-03 12:44:07

> On 01.04.2012, at 22:13, Christophe Henry wrote:
>>> on Thu Mar 29 2012, "Christophe Henry"
>>> <> wrote:
>>>>> Jurai,
>>>>> On Thu, Mar 29, 2012 at 7:07 PM, Juraj Ivančić
>>>>> <juraj.ivancic_at_[hidden]> wrote:
>>>>>> I know how you feel. MSM is an awesome library. Unfortunately
>>>>>> compilers tend
>>>>>> to disagree :)
>>>> I'd say compilers should be blamed for this ;-) (I'm still wondering
>>>> how it can be that compilers make such a poor use of my 6 cores with
>>>> hyperthreading when compile a single object file...)
>>> There isn't much inherent parallelism to exploit in C++ compilation of a
>>> single translation unit.
>>> --
>>> Dave Abrahams
>>> BoostPro Computing
>> I'm not an expert in this field, but this surprises me a bit.
>> I understand that there is not much parallelism in parsing a file, but
>> after?
>> Taking msm as example. Most of the compile time comes from template
>> instanciations of the function process_event for every event type. Adding
>> support for a new event adds roughly the same compilation time. Every
>> process_event has little in common with other process_event instances.
>> What prevents the compiler from handling each at the same time?
> The locking mechanism for ASTs would probably be very complicated if you
> want to do template instantiation in parallel. It probably could be done,
> but going that route isn't very attractive because the cores are much
> better used compiling 6 files in parallel.
> Sebastian

Sure but it's still very annoying because in a well-designed application
with little dependency, I work very very often on a single cpp file where my
state machine (or other boost-heavy code) is used and have to wait up to 2mn
that this file is compiled with 1 thread while my other 11 are bored. Then I
wait until linking is done, on 1 thread.
This doesn't look like a very good usage of my cores either ;-)

I hereby make the promise to switch all my applications to the first
standard-conform compiler which compiles this one file on 12 threads thus
saving me hours per year :)


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at