On 10/01/15 04:14, Thomas Schwinge wrote:
Hi Nathan!

On Mon, 28 Sep 2015 11:56:09 -0400, Nathan Sidwell <nat...@acm.org> wrote:
I've committed this to remove the now no longer needed lock and unlock builtins
and related infrastructure.

If I understand correctly, it is an implementation detail of the nvptx
offloading implementation that it doesn't require such locking
primitives, but such locking may still be required for other (future)
offloading implementations, at which point something like the following
would have to be introduced again:

I thought about that. Other implementations can also use the lockless idiom. There's always going to be a cmp&swap atomic, otherwise the HW is terribly designed. lock/unlock doesn't work between PTX warps, as we've discovered, and I think the same will probably be true of HSA, as that's roughly the same conceptually. If it turns out I'm wrong, these bits can always be resurrected then.

The reason I originally went with lock/unlock is that it was conceptually simpler. The lockless scheme is quite straight forwards, once one understands the underlying concept.

nathan

Reply via email to