|
Boost Users : |
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2007-07-02 17:18:22
Ovanes,
> >> > I would like to start multiple preprocessing threads. Is wave
> >> > thread-safe or there some points I should take in account?
> >>
> >> Wave object instances are not thread safe. Wave doesn't
> contain any
> >> thread related code at all. You'll have to protect the wave object
> >> instances from thread related issues yourself.
> >
> > Being thread-unaware does not mean your code is thread unsafe:
> > you're most likely providing the basic thread-safety guarantee as
> > defined in
> >
> > http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2298.html
> >
> > as long as boost::wave::context etc. do not have class static data.
>
> Yes, that is exactly what I mean: reentrant member functions
> and no static data which can be damaged by parallel execution
> of multiple context instances...
>
> My intention is:
> I have a lot of source files, which I would like to
> preprocess by some number of threads. Each thread will own a
> dedicated context instance and preprocess the source file.
> Will this work, of do you for example have some static tables
> or whatever, which would be written by this contexts at the same time?
The overall idea is:
Yes, the Wave code is reenterant and doesn't have any static or global data.
And yes, Wave provides the basic thread-safety guarantee as defined in the
paper mentioned above.
But I just looked again at the file wave_config.hpp and as it turns out I'll
need to add some more pp based magic there for Wave to be fully thread
aware/safe (there are two libraries I have to configure correctly to
guarantee thread safety: Boost.Spirit and Boost.Pool). I'll try to fix it
asap.
Regards Hartmut
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