From: Tobias Schwinger (tschwinger_at_[hidden])
Date: 2007-08-27 12:14:54


Gottlob Frege wrote:
> On 8/26/07, Tobias Schwinger <tschwinger_at_[hidden]> wrote:
>
> I don't like the idea of important and *exposed* items being 'accepted
> as an implementation detail'.
>

Yep.

>> However, I'd at least very much welcome a test suite for LWCO.
>>
>
> Unless carefully reviewed, all threading code has bugs. Even if
> tested. It is the nature of threaded code. It is *extremely* hard to
> test in such a way that all possible cases are tried.

I hope you're not saying one shouldn't test multi-threaded code just
because it's hard to test ;-).

>> That's not quite what I meant:
>>
>> // 'initialized' started being false
>>
>> if (initialized)
>> {
>> // 'initialized' is true for sure
>
> 'initialized is true for sure, but, without a read barrier, we can't
> be sure that the objects initialized are seen that way by the current
> processor.

It depends on what processor that is. See e.g:

      http://ridiculousfish.com/blog/archives/2007/02/17/barrier/

for a discussion

Most processors have linear write buffers and if 'initialized' is seen
as true the object has been written, too.

Regards,
Tobias