[flext] Flext on 64-bit Windows

Thomas Grill gr at grrrr.org
Tue Apr 30 10:41:25 CEST 2019


Oh, ok.
Anyway, that's fine!
I think that we can rely on C++11 support these days, even the free Visual Studio compiler seems to support it.
I don' think one needs to support compilers apart from gcc, clang and VS.
thanks, all the best,
Thomas

> Am 30.04.2019 um 08:56 schrieb Jamie Bullock <jamie at jamiebullock.com>:
> 
> Okay…
> 
> AFAICT atomic ops *are* required even if FLEXT_THREADS is not defined. This is because the ToOut* methods in flout.cpp use the following pattern:
> 
> FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::ToOutBang(int n) const
> {
>    if(CHKTHR()) ToSysBang(n); else ToQueueBang(n);
> }
> 
> ToQueue* sends to a lock-free queue, which requires CAS.
> 
> So, question is: do we want to
> 
> 	1. replace all of the current platform-specific atomics with the portable code from std::atomic, or
> 	2. keep the existing code and *add* additional conditional sections that use std::atomic *only if* a C++11 compiler is available
> 
> I’m personally in favour of “1”. It would make Flext dependent on C++11 but would greatly simplify the code. It also opens the possibility of replacing pthreads with std::thread and other improvements in the future.
> 
> Cheers,
> Jamie
> 
> 
>> On 15 Apr 2019, at 19:51, Thomas Grill <gr at grrrr.org> wrote:
>> 
>> Hi Jamie,
>> thanks for bringing this up!
>> I would accept any reasonable pull request dealing with this.
>> On the other hand, as long as builds are not threaded, which is usually the case, the code doesn't need to depend on atomic operations. This should be separated in case it is not the case right now.
>> best, Thomas
>> 
>>> Am 15.04.2019 um 18:43 schrieb Jamie Bullock <jamie at jamiebullock.com>:
>>> 
>>> Hello list…
>>> 
>>> Flext doesn’t support 64-bit builds on Windows, and therefore doesn’t support Max 8, which AFAICT is 64-bit only.
>>> 
>>> This is due to an inline assembly block in the atomic CAS implementation… Inline assembly isn’t supported for x64 builds.
>>> 
>>> Does anyone have any suggestions for how to get around this?
>>> 
>>> My opinion is that the code in Flext is pretty ancient now, and as we have std::atomic and std::thread since C++11, it should be updated to use those. I’d be willing to have a go at refactoring along these lines if people agree it’s a good option and / or there aren’t existing solutions to the above.
>>> 
>>> Jamie
>>> _______________________________________________
>>> https://grrrr.org/ext/flext
>>> 
>>> flext mailing list
>>> flext at grrrr.org
>>> https://grrrr.org/cgi-bin/mailman/listinfo/flext
>> 
>> --
>> Thomas Grill
>> http://grrrr.org
>> 
>> 
> 

--
Thomas Grill
http://grrrr.org


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 874 bytes
Desc: Message signed with OpenPGP
URL: <http://grrrr.org/pipermail/flext/attachments/20190430/6bcdbb5e/attachment.sig>


More information about the flext mailing list