[cfe-dev] [libcxx] A few questions about external threading support

Eric Fiselier via cfe-dev cfe-dev at lists.llvm.org
Wed Mar 29 12:38:47 PDT 2017


On Tue, Mar 28, 2017 at 9:51 PM, Liu Hao via cfe-dev <cfe-dev at lists.llvm.org
> wrote:

> Hello libcxx developers:
>
> I am the maintainer of the mcfgthread library (
> https://github.com/lhmouse/mcfgthread). At the moment I provide support
> for libstdc++ only, but I am also willing to add support for libcxx. Here
> are a few questions:
>
> 1. The prototype of `__libcpp_recursive_mutex_trylock()` was changed from
> RELEASE_400 to trunk. It used to return an `int` but now it returns a
> `bool` instead. Since the old function returns zero on success while the
> new function returns non-zero on success, this results in horrible
> incompatibility. Would you please provide some details about why you
> changed its return type?
>

All callers of `__libcpp_foo_trylock()` functions return bool so it made
more sense to convert the return value to bool once inside the
`__threading_support` interface rather than at each callsite. I'm not sure
what incompatibility this causes since the callers should have been updated
too.



> 2. There is no `__libcpp_recursive_mutex_timedlock()`.
> `std::recursive_mutex` is implemented using a non-recursive mutex plus a
> condition variable. Are there any reasons why you don't make use of it? I
> know that Windows SRW lock doesn't support timed locking but
> `pthread_mutex_timedlock()` is a standard function in POSIX so it should be
> used in favor of sort of emulation.
>

I'm not sure why. I'll have to look into it further. I suspect it might be
related to the clock used by pthread_mutex_trylock but IDK. I'll look into
the suggested implementation further.
However changing it now would require an ABI break, which is unfortunate
but not insurmountable.


> 3. The inline assembler in Clang doesn't support Intel syntax even with
> `-masm=intel`. Is there a command line option to have Clang pass asm code
> directly to the assembler that accepts Intel syntax?
>
> Thanks in advance.
>
> --
> Best regards,
> LH_Mouse
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170329/364cfc04/attachment.html>


More information about the cfe-dev mailing list