On Apr 21, 2008, at 1:04 PM, Adam Leventhal wrote:
> On Mon, Apr 21, 2008 at 11:45:25AM -0700, James McIlree wrote:
>>> Either we need to use some temporary, probe-local variable (one  
>>> that can't
>>> conflict with a user-defined variable), or we need to perform some  
>>> element
>>> of optimization to the generated DIF.
>>>
>>> I've filed this bug:
>>>
>>> 6691541 curlwpsinfo->pr_stype races
>>
>> If you choose to do some element of optimization, is it possible to  
>> guarantee
>> every case will be correctly handled? I worry that it might be  
>> difficult to
>> reason about the thread safety of code without explicit guarantees  
>> about how
>> this is handled.
>
> The optimization would just be to perform the load once -- this is  
> what most C
> compilers would do absent the volatile keyword.

        And I absolutely would not trust the C compiler in this case  
either :-).
It's not required by spec to load once and only once, and there are  
times when
it doesn't.

        James M

_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org

Reply via email to