[haiku-commits] Re: haiku: hrev50886 - in src: add-ons/media/media-add-ons/multi_audio kits/media/experimental

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 20 Jan 2017 23:41:54 +0100

Am 20/01/2017 um 23:13 schrieb Julian Harnath:

On 20.01.2017 22:54, Axel Dörfler wrote:
There are plenty of examples on how to quit a thread; just making the
bool volatile would be enough to ensure it's properly quit.
This is not quite right: while volatile does impose a few restrictions
for the compiler regarding the memory accesses (but even there, ordering
is only kept in relation to other volatiles!), it does nothing to
enforce visibility and intended order on the hardware side.

We're waiting here on a bool value becoming true. There are no memory ordering issues; there is no going back either.
Visibility would only be a problem if the cache is not coherent. I
don't think we support a such an architecture (AFAIK both ARM and PPC are cache coherent, too).

So while atomics may be cleaner, there is no difference in this use case AFAICT.

Bye,
   Axel.

Other related posts: