F
Flavio
Hi, I try to write here because maybe my problem is a common one.
I have a rather complicated multithreaded program, which uses the POSIX
pthread standard.
A master routine calls a series of slave routines.
My problems is about output. If I use the standard syntax:
.....
cout << "Hi, I am thread number" << i << endl;
.....
anything goes right. But if instead I try to send the output to a file,
opened in the usual way:
.....
out.open("Calcolo_Parallelo.log", ios::app);
.....
.....
out << "Hi, I am thread number" << i << endl;
.....
sometimes the output is not written. I haven't understood which lines
of code are written and which others not, but approximately a 50% of
the total output requested is missed (and where is it finished???).
Somebody has an idea of how to solve this problem?
Thank you,
Flavio Cimolin
I have a rather complicated multithreaded program, which uses the POSIX
pthread standard.
A master routine calls a series of slave routines.
My problems is about output. If I use the standard syntax:
.....
cout << "Hi, I am thread number" << i << endl;
.....
anything goes right. But if instead I try to send the output to a file,
opened in the usual way:
.....
out.open("Calcolo_Parallelo.log", ios::app);
.....
.....
out << "Hi, I am thread number" << i << endl;
.....
sometimes the output is not written. I haven't understood which lines
of code are written and which others not, but approximately a 50% of
the total output requested is missed (and where is it finished???).
Somebody has an idea of how to solve this problem?
Thank you,
Flavio Cimolin