stdio performance in tango, stdlib, and perl

James Dennett jdennett at acm.org
Sat Mar 24 07:14:10 PDT 2007


Walter Bright wrote:
> Bill Baxter wrote:
>> James Dennett wrote:
>>> Walter Bright wrote:
>>
>>> It might be harsh, but not entirely unjustified, to say
>>> that the "conventional wisdom" of many communities of
>>> programmers is a long, long way from being wise.  As
>>> the community behind a language grows larger, there is
>>> a natural tendency for it not to have some a density
>>> of experts; if D amasses a million users it's a safe
>>> bet than most of them won't be as sharp as the average
>>> D user is today.
> 
> D bucks conventional wisdom in more than one way. There's a current
> debate going on among people involved in the next C++ standardization
> effort about whether to include garbage collection or not. The people
> involved are arguably the top tier of C++ programmers.
> 
> But still, there are one or two that repeat the conventional (and wrong)
> wisdom about garbage collection. Such conventional wisdom is much more
> common among the general population of C++ programmers.

Which "wrong" assertions are those?

>> I think there is a tendency to assume that APIs and languages which
>> have (A) been around a long time and
>> (B) been used by millions of people
>> will probably be close to optimal.  It just makes sense that that
>> would be the case.  Unfortunately, it's all too often just not true.
> 
> I just find it strange that C++, a language meant for building speedy
> applications, would incorporate iostreams, which is slow, not thread
> safe, and not exception safe.

I'm intrigued by your claim that IOStreams is not thread-safe;
the IOStreams framework is thread-safe in the same way that
the STL is thread-safe.  The one minor difference is that
IOStreams exposes some global variables, which is unfortunate
as they can easily be used in inappropriate ways in a
multi-threaded environment.  Then again, that is unsurprising
as C++ does not yet officially incorporate support for
multi-threading.  Is there something deeper in IOStreams that
you consider to be thread-unsafe, or is it just the matter of
its global variables?

-- James



More information about the Digitalmars-d mailing list