This is an archive of the discontinued LLVM Phabricator instance.

[ThreadPool] Simplify the interface
AbandonedPublic

Authored by davide on Nov 28 2016, 2:05 AM.

Details

Summary

The returned std::future is unused.

Diff Detail

Event Timeline

davide updated this revision to Diff 79378.Nov 28 2016, 2:05 AM
davide retitled this revision from to [ThreadPool] Simplify the interface.
davide updated this object.
davide added reviewers: Bigcheese, mehdi_amini.
davide added a subscriber: llvm-commits.
mehdi_amini edited edge metadata.Nov 28 2016, 5:18 PM

What is the motivation? This is removing a feature. Even though it is not used at that time, it is tested and could find its use in the future.

What is the motivation? This is removing a feature. Even though it is not used at that time, it is tested and could find its use in the future.

This is pretty much dead code. If you're going to find a consumer using this feature, you can add it again. I plan to merge the lld and the llvm thread pool interface and this removes the dependence on <future> (and makes the merge slightly simpler).

Why is the dependency on future an issue?

Why is the dependency on future an issue?

Because it complicates the interface, for no reason (atm, as nobody uses it).
If you prefer the code to stay as is, fine, but we will keep having two different implementations in-tree.

If you prefer the code to stay as is, fine, but we will keep having two different implementations in-tree.

You're not explaining why it prevents the merge.

Maybe submitting another patch for the merge, and marking this one as blocking could help motivating this patch.

If you prefer the code to stay as is, fine, but we will keep having two different implementations in-tree.

You're not explaining why it prevents the merge.

It makes it harder for me. If it doesn't for you, feel free to go ahead. In general, I shouldn't explain why I want to remove dead code from the tree (as it's dead).

davide abandoned this revision.Nov 28 2016, 5:46 PM
davide reclaimed this revision.Nov 28 2016, 7:18 PM
mehdi_amini added inline comments.Nov 28 2016, 11:20 PM
unittests/Support/ThreadPool.cpp
102

You need to make sure this works with LLVM_ENABLE_THREADS=OFF

[49/49] Running the LLVM regression tests
Testing Time: 259.34s
  Expected Passes    : 18270
  Expected Failures  : 121
  Unsupported Tests  : 386
$ grep ENABLE_THREADS CMakeCache.txt
LIBCXXABI_ENABLE_THREADS:BOOL=OFF
//\n   This option may only be set to OFF when LIBCXX_ENABLE_THREADS=OFF.
LIBCXX_ENABLE_THREADS:BOOL=OFF
LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS:BOOL=ON
//\n   This option may only be set to ON when LIBCXX_ENABLE_THREADS=ON.
LLVM_ENABLE_THREADS:BOOL=OFF
[49/49] Running the LLVM regression tests
Testing Time: 259.34s
  Expected Passes    : 18270
  Expected Failures  : 121
  Unsupported Tests  : 386
$ grep ENABLE_THREADS CMakeCache.txt
LIBCXXABI_ENABLE_THREADS:BOOL=OFF
//\n   This option may only be set to OFF when LIBCXX_ENABLE_THREADS=OFF.
LIBCXX_ENABLE_THREADS:BOOL=OFF
LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS:BOOL=ON
//\n   This option may only be set to ON when LIBCXX_ENABLE_THREADS=ON.
LLVM_ENABLE_THREADS:BOOL=OFF
unittests/Support/ThreadPool.cpp
102

I tried to run the testsuite with ENABLE_THREADS=OFF. Is there any other test you recommend to run or is this fine?

So, @Bigcheese / @mehdi_amini , can this get in?

davide abandoned this revision.Dec 13 2016, 6:33 PM

Put this on hold until we have a new API. it's probably easier to replace it directly when @Bigcheese will have the new implementation in.