Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 23rd, 2005, 04:51 AM
Kashish
Guest
 
Posts: n/a
Default Is file<<"Some string"<<endl is an atomic operation.

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?


  #2  
Old July 23rd, 2005, 04:51 AM
msalters
Guest
 
Posts: n/a
Default Re: Is file<<"Some string"<<endl is an atomic operation.



Kashish schreef:[color=blue]
> Is file<<"Some string"<<endl is an atomic operation.
> where file is an ofstream object.[/color]

No.

HTH,
Michiel Salters

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.