
07-08-2005, 03:40 PM
|
 |
Sinecure Expert
Super Moderator * Guru *
|
|
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 7,714
|
|
|
What compiler on what operating system, what options were the libraries compiled with.
I/O (especially since I would think you shouldn't be mixing the two), can often come out in unexpected order, depending on internal buffering, and threading options.
Perhaps you have a threaded I/O library, so the cout stream is no wait I/O. The I/O is buffered in a queue to be processed by another thread, and your thread continues and you immediately send old, direct printf I/O which is not no wait, and it goes out immediately, followed
later by the cout stream which executes after your primary thread relinquishes the processor.
Could this be a multiprocessor machine where code is running on one processor, with Operating System (and I/O) running on another processor?
|
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
|