template statistics

Steven Schveighoffer schveiguy at gmail.com
Wed Jun 3 21:04:23 UTC 2020


On 6/3/20 4:29 PM, Stanislav Blinov wrote:
> On Wednesday, 3 June 2020 at 20:05:39 UTC, Walter Bright wrote:
>> On 6/3/2020 7:58 AM, Stanislav Blinov wrote:
>>> A good `writeln` would not call into C  at all.
>>
>> C's puts() is thread safe. No reason to not use it.
> 
> A thread-safe writeln would be threadsafe_writeln. Or, alternatively 
> there would be a writeln and a not_threadsafe_writeln. No reason to pay 
> for something you're not using. And still neither implementation would 
> call into C, the OS is right there.

writeln writes to a FILE *, which is C. There's no way around it. FILE * 
is buffered i/o, so going around it would mean odd out-of-order output.

-Steve


More information about the Digitalmars-d mailing list