
Hello Hartmut! I would like to start multiple preprocessing threads. Is wave thread-safe or there some points I should take in account? With Kind Regards, Ovanes Markarian

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. Regards Hartmut

----- Mensaje original -----
De: Hartmut Kaiser
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. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

On Mon, July 2, 2007 21:02, "JOAQUIN LOPEZ MU?Z" wrote:
----- Mensaje original ----- De: Hartmut Kaiser
Fecha: Lunes, Julio 2, 2007 8:23 pm Asunto: Re: [Boost-users] [wave] thread safety??? Para: boost-users@lists.boost.org 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.
Joaquín M López Muñoz Telefónica, Investigación y Desarrollo _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
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? With Kind Regards, Ovanes Markarian

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

On Mon, July 2, 2007 23:18, Hartmut Kaiser wrote:
Ovanes,
[...]
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 mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hartmut, can you please notify me (if not here, then through a private message)? I could test it for you. With Kind Regards, Ovanes Markarian

Ovanes,
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.
can you please notify me (if not here, then through a private message)? I could test it for you.
Will do. Give me a day or two, please. Regards Hartmut

Ovanes,
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
can you please notify me (if not here, then through a private message)? I could test it for you.
I (hopefully) fixed the thread related configuration and it's checked into the Boost CVS::HEAD. Regards Hartmut
participants (3)
-
"JOAQUIN LOPEZ MU?Z"
-
Hartmut Kaiser
-
Ovanes Markarian