[PATCH] [libcxx] Windows port of thread/mutex/chrono

G M gmisocpp at gmail.com
Wed Oct 16 13:40:05 PDT 2013


Hi Nico

It's not intended as a pthreads port, and the features are far from
> complete for that. For one, there's no single mutex type for recursive and
> non-recursive mutexes. If someone is so inclined he can force usage of
> pthreads and use an external lib. Mimicking pthreads but only implementing
> a small part of it will only lead to problems.
>
Ok fair enough, others have alluded to a similar view point.

>
>  * The _LIBCPP_PTHREADS macro name is a little confusing to me. I think it
>> means, "use the existing path that say libcxx uses for pthreads today,
>> otherwise using the new / built in one".
>>
>
> It just means "use pthreads". It's never used in negative checks, and the
> second path is always conditioned on _WIN32 being defined.
>
ok.

>
>  * The inline assembler might be able to be factored out, or out more:
>> The win32 platform and clang appear to support the intrinsic bit test
>> functions and see their are psdk intrinsics that provide the same thing.
>>
>
> Last I checked Clang doesn't support the MSVC bts intrinsic.
>
Are you sure? The Windows platform will though right?, just #if pthread,
#elif _WIN32 #else #error should get the right result I think. If not. if
this is the right asm code, perhaps we should get this intrinsic added to
clang. I'm not saying you should do this, but I think that should be the
aim (advice please clang devs). I feel strongly against inline asm in
libcxx if it can at all be avoided.

>
>> Patch 2 adds ntdll.dll to the linker so not sure what's going wrong there.
>>
>> Try as it might, I couldn't get this to work without manually adding it
here. I tried all kinds of cmake stuff and nothing worked. I'm sure it's a
simple two lines once you know what the two lines are. I didn't see
anything in the patch, maybe I have patch 1 or something. I'll look for it
again.

>  Too bad Phabricator doesn't support patch chains so you have to mash
>> everything together. Multiple Phab entries that depend on each other are
>> also a PITA.
>>
>
Talking of Phabricator, I thought the whole point of the internet was
nobody knows you are a dog. If my dog wants to write a review for me, why
not? Can we remove these restrictions on having to divulge age, gender, and
photo please etc.? I find them unwanted and unnecessary. It's starting to
take the fun out of contributing to anything having the "system" try to
take more than I'm already giving. This isn't facebook nor should it be.
Thanks


>
>> Thanks for looking at this.
>> -Nico
>>
>
Thanks for working on this.
PS Can you add this to the chrono patch, otherwise it derails g++. Similar
I couldn't make g++ stop warning on all the #pragma diagnostic things in
win.h. If you try a g++ build you will see.
+    typedef chrono::duration<long long, ratio<1, 10000000> > duration;

Thanks - GM's dog.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131017/502f669f/attachment.html>


More information about the cfe-commits mailing list