From: Yuval Ronen (ronen_yuval_at_[hidden])
Date: 2007-03-25 12:58:27


Peter Dimov wrote:
> Yuval Ronen wrote:
>
>> Ok, so we come again to what seems to be the true heart of the debate.
>> Do we want interoperability between the C library and the C++ library,
>> and how much are we willing to pay for it. And it seems we give
>> different answers to this question.
>
> One reason for the different answers to this question is that you seem to be
> attributing costs where there may be none, without bothering to go into
> specifics so that your claims can be either challenged or acknowledged and
> justified.

Ok, here's an example. It's about mutexes. Bear in mind that I'm talking
about interface design costs, not performance costs.

If I want my C code to access C++ mutexes I have to expose the
pthread_mutex_t member from the std::mutex class. That's a cost (albeit
a minor one). If I want my C++ code to access C mutexes I have to make a
std::mutex refer to some pthread_mutex_t that is not a member of it.
That's a more major cost.

> If you list specific concerns with the idea of basing <thread> on
> <pthread.h>, we'll be able to stick to technicalities and move away from
> what seems to have become a flame war - and maybe even produce something
> useful as a result of the discussion.

Flame war? God forbid, no. I have the utmost respect for everybody
involved (including myself ;-)). Was I getting personal at any stage? If
so, my deep apologies.

In general I can say that there's nothing wrong with accepting
<pthread.h>, but basing <thread> on it is simply not necessary. Being
the minimalist I am, I think that if it doesn't need to be, it needs to
be not. Do what you have to, nothing more, nothing less.