Is file<<"Some string"<<endl is an atomic operation.

K

Kashish

Is file<<"Some string"<<endl is an atomic operation.
where file is an ofstream object.

If we output a string in ofstream and we provide endl after that,Can we
make sure the whole string will be put in file at a time or the string
can appear in parts.String lenfth is no more than 50 chars.

I have 2 processes on different solaris boxes (NFS) running in
parallel.one process writing lines to the file and other process
reading lines from the file. Can we make sure filestream and endl that
reading process will never get half entry. Either it will get full
entry or no entry. or Do I need to use File Locking?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top