This is an archive of the discontinued LLVM Phabricator instance.

Use ThreadLauncher to launch TaskPool threads
ClosedPublic

Authored by fjricci on Sep 15 2017, 1:55 PM.

Details

Summary

This allows for the stack size to be configured, which isn't
possible with std::thread. Prevents overflowing the stack when
performing complex operations in the task pool on darwin,
where the default pthread stack size is only 512kb.

Diff Detail

Repository
rL LLVM

Event Timeline

fjricci created this revision.Sep 15 2017, 1:55 PM
clayborg accepted this revision.Sep 15 2017, 2:10 PM
This revision is now accepted and ready to land.Sep 15 2017, 2:10 PM
tberghammer accepted this revision.Sep 18 2017, 3:10 AM

Looks good

source/Utility/TaskPool.cpp
61 ↗(On Diff #115484)

(nit): Can you create a named constant for the min stack size as just based on this line I would have no idea what does that number do?

This revision was automatically updated to reflect the committed changes.
fjricci reopened this revision.Sep 18 2017, 8:46 AM

Is ThreadLauncher unavailable in this code for some reason? The link failed on linux buildbots (building lldb on Darwin was fine locally): http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/13311/steps/run%20unit%20tests/logs/stdio

This revision is now accepted and ready to land.Sep 18 2017, 8:46 AM
fjricci updated this revision to Diff 115691.Sep 18 2017, 11:30 AM

Move TaskPool from Utility to Host

fjricci requested review of this revision.Sep 18 2017, 11:32 AM
fjricci edited edge metadata.
tberghammer accepted this revision.Sep 19 2017, 6:59 AM

I don't really have an opinion if moving TaskPool to Host is a good or bad idea (haven't followed the recent layering efforts) but other then that looks good. I also tested it on Linux and it works fine.

This revision is now accepted and ready to land.Sep 19 2017, 6:59 AM
clayborg accepted this revision.Sep 19 2017, 8:34 AM
This revision was automatically updated to reflect the committed changes.
lldb/trunk/unittests/Host/TaskPoolTest.cpp