Programming Windows D Examples are now Online!

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Jun 22 14:20:18 PDT 2011


On 6/22/11 3:49 PM, Johannes Pfau wrote:
> Walter Bright wrote:
>> On 6/22/2011 12:01 PM, Andrej Mitrovic wrote:
>>> I just ran into some odd stdout corruption issue while doing parallel
>>> builds, take a look:
>>
>> stdout is shared, but the atomic units of output are where the calls
>> to it are, and are interleaved otherwise. For example, a single call
>> to printf locks stdout for the duration of the printf.
>
> C printf is atomic? Didn't know that.
> What happens when multiple processes are spawned with system()? Is
> their IO output still synchronized?

No, printf is atomic across threads. Spilling buffers to disk is a 
distinct issue.

Andrei


More information about the Digitalmars-d-announce mailing list