[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: [PATCH 1/5] d3d9: Refuse to reset a lost device.
From:       Henri Verbeet <hverbeet () gmail ! com>
Date:       2014-11-30 18:08:31
Message-ID: CAOsNvwz0C1_eqqE5CHrZ5mrAwjC0oezEBEtfw5b28ga_GvTr6g () mail ! gmail ! com
[Download RAW message or body]

On 30 November 2014 at 18:28, Stefan Dösinger <stefandoesinger@gmail.com> wrote:
> Am 2014-11-28 16:08, schrieb Henri Verbeet:
>> Do you need the InterlockedCompareExchange()?
> Tbh I'm not sure when it is needed and when it isn't, so I chose to go
> for the safe option. I know the read of device->device_state should be
> atomic if its address is 4 byte aligned (and if it isn't
> InterlockedCompareExchange won't help). But on the other hand you've
> used it for read-only access in the fence implementation in your
> command stream work. What was the reason for that? Preventing the loop
> from looping over an unchanged register?
That code wasn't anything particularly final, but
InterlockedCompareExchange() implies a memory barrier and would
prevent the CPU from seeing stale values. I don't think seeing a stale
value would really matter here, but if it does this probably also
isn't enough since you're not protected from e.g. focus loss in the
middle of a reset either.



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic