[mythtv] [patch] thread safe verbose macro v4

Daniel Thor Kristjansson danielk at mrl.nyu.edu
Tue Mar 1 02:23:40 UTC 2005


On Mon, 28 Feb 2005, thor wrote:
]On Monday 28 February 2005 08:57 pm, Daniel Thor Kristjansson wrote:
] I had always assumed that iostream was threadsafe. Is that not the case?

Yes and no, it won't crash, but the characters of 
two simultaneous string writes will overlap.

i.e.
Thread 1: cout<<"ABC";
Thread 2: cout<<"123"

might give you

A1BC23 
1AB2C3
A1B23C
etc, etc

-- Daniel


More information about the mythtv-dev mailing list