Hi,
I am using Common C++ Thread class for my Project. My thread uses cout function to output some debugging information to the stdout. But it does not work. Is there any problem in using cout function with Common C++ Library.
Thanks,
Latha
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Depending on how you use it I suppose it is possible to get interleaving I/O from different threads. You could use a mutex shared between your thread classes to protect against this. Alternately you can use slog rather than cout for outputting debugging messages; slog is gaurenteed to be thread atomic.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am using Common C++ Thread class for my Project. My thread uses cout function to output some debugging information to the stdout. But it does not work. Is there any problem in using cout function with Common C++ Library.
Thanks,
Latha
Depending on how you use it I suppose it is possible to get interleaving I/O from different threads. You could use a mutex shared between your thread classes to protect against this. Alternately you can use slog rather than cout for outputting debugging messages; slog is gaurenteed to be thread atomic.