summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Threads.h
Commit message (Collapse)AuthorAgeFilesLines
* [lld] Move Threads to CommonBob Haarman2017-10-131-91/+0
| | | | | | | | | | | | | | | | Summary: This will allow using the functionality from other linkers. It is also a prerequisite for sharing the error logging code. Reviewers: ruiu Reviewed By: ruiu Subscribers: emaste, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D38822 llvm-svn: 315725
* Wait for all threads to terminate before exitting.Rui Ueyama2017-10-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | I think it is not defined what would happen to detached threads when the main thread tries to exit. That means it was not guaranteed that unlinkAsync correctly removes a temporary file. It was also reported that this unlinkAsync caused a crash on Windows. This patch adds a few new functions so that the main thread always waits for non-main threads before exitting. I don't actually like the new two functions, runBackground and waitForBackgroundThreads, because it looks like it is a bit overdesigned. After all, what we are doing with these functions is to just remove a file. An alternative would be to do fork(2) and make the child process remove a file asynchronously. However, it has its own problems. Correctly forking and reclaiming a resource using waitpid(2) is not doable unless we know our process-wide settings (such as signal mask), but we can't make any assumption on it when lld is embedded to other process. So I chose to stick with threads instead of multi-processes. Differential Revision: https://reviews.llvm.org/D38571 llvm-svn: 315033
* Update comments: parallel_for_each -> parallelForEachSam Clegg2017-08-231-1/+1
| | | | | | | | Also remove unused include of raw_ostream.h Differential Revision: https://reviews.llvm.org/D37048 llvm-svn: 311587
* [ELF] - Replace parallelForEach with ranged form.George Rimar2017-08-041-4/+3
| | | | | | | | Makes code a bit more convinent to write/read. Differential revision: https://reviews.llvm.org/D36089 llvm-svn: 310040
* [ELF] - Apply clang-format. NFC.George Rimar2017-07-181-2/+2
| | | | llvm-svn: 308297
* [Support] Move Parallel algorithms from LLD to LLVM.Zachary Turner2017-05-111-5/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D33024 llvm-svn: 302748
* Remove unused #include.Rui Ueyama2017-05-101-1/+0
| | | | llvm-svn: 302719
* Rename parallelFor -> parallelForEachN.Rui Ueyama2017-05-101-2/+2
| | | | | | So that it is clear that the function is a wrapper for for_each_n. llvm-svn: 302718
* [Core] Make parallel algorithms match C++ Parallelism TS.Zachary Turner2017-05-101-8/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D33016 llvm-svn: 302613
* Update comments.Rui Ueyama2017-03-241-2/+2
| | | | llvm-svn: 298669
* Rename forEach -> parallelForEach and forLoop -> parallelFor.Rui Ueyama2017-03-221-2/+3
| | | | | | | "Parallel" is the most important aspect of the functions, so we shouldn't omit that. llvm-svn: 298557
* Update comment to clarify the machine spec.Rui Ueyama2016-12-041-4/+5
| | | | llvm-svn: 288609
* Add comments about the use of threads in LLD.Rui Ueyama2016-12-031-0/+48
| | | | llvm-svn: 288606
* Factor out common code to a header.Rui Ueyama2016-12-031-0/+41
llvm-svn: 288599
OpenPOWER on IntegriCloud