Opened 9 years ago

Closed 9 years ago

#9193 closed Patches (fixed)

Add DCAS support for Windows 32-bit

Reported by: Gavin Lambert <gavinl@…> Owned by: timblechmann
Milestone: To Be Determined Component: atomic
Version: Boost 1.54.0 Severity: Problem
Keywords: windows x86 Cc:

Description

Currently Boost.Atomic does not support 64-bit atomics as lock-free when compiled for 32-bit Windows.

The attached patch adds this ability by using _InterlockedCompareExchange64 (which is the only 64-bit intrinsic available for x86) to synthesise the other operations, albeit with lesser performance than if a "real" atomic were available.

Attachments (1)

atomic_dcas_win.patch (2.9 KB ) - added by Gavin Lambert <boost@…> 9 years ago.

Download all attachments as: .zip

Change History (3)

by Gavin Lambert <boost@…>, 9 years ago

Attachment: atomic_dcas_win.patch added

comment:1 by Gavin Lambert <gavinl@…>, 9 years ago

Possibly I should add that without this patch, Boost.LockFree's queue is not actually lock free when compiled with a pre-C++11 compiler, as tagged_ptr requires DCAS.

comment:2 by timblechmann, 9 years ago

Resolution: fixed
Status: newclosed

(In [86144]) atomic: 64bit cas support for 32bit windows

fixes #9193

Note: See TracTickets for help on using tickets.