Displaying 5 results from an estimated 5 matches for "knumthreads".
2013 Oct 03
2
[LLVMdev] question about -coverage
...simple stress test shows that coverage slows down by 50x!
% cat ~/tmp/coverage_mt.cc
#include <pthread.h>
__thread int x;
__attribute__((noinline))
void foo() {
x++;
}
void *Thread(void *) {
for (int i = 0; i < 100000000; i++)
foo();
return 0;
}
int main() {
static const int kNumThreads = 16;
pthread_t t[kNumThreads];
for (int i = 0; i < kNumThreads; i++)
pthread_create(&t[i], 0, Thread, 0);
for (int i = 0; i < kNumThreads; i++)
pthread_join(t[i], 0);
return 0;
}
% clang -O2 ~/tmp/coverage_mt.cc -lpthread ; time ./a.out
TIME: real: 0.284; user: 3.560; s...
2013 Oct 04
0
[LLVMdev] question about -coverage
...verage_mt.cc
> #include <pthread.h>
> __thread int x;
> __attribute__((noinline))
> void foo() {
> x++;
> }
>
> void *Thread(void *) {
> for (int i = 0; i < 100000000; i++)
> foo();
> return 0;
> }
>
> int main() {
> static const int kNumThreads = 16;
> pthread_t t[kNumThreads];
> for (int i = 0; i < kNumThreads; i++)
> pthread_create(&t[i], 0, Thread, 0);
> for (int i = 0; i < kNumThreads; i++)
> pthread_join(t[i], 0);
> return 0;
> }
>
> % clang -O2 ~/tmp/coverage_mt.cc -lpthread ; ti...
2014 Apr 25
2
[LLVMdev] multithreaded performance disaster with -fprofile-instr-generate (contention on profile counters)
...gt; return 0;
>> }
>>
>> __attribute__((noinline)) void bar() { v[999] = 66; }
>>
>> void *Thread2(void *) {
>> for (int i = 0; i < 100000000; i++)
>> bar();
>> return 0;
>> }
>>
>> int main() {
>> static const int kNumThreads = 16;
>> pthread_t t[kNumThreads];
>> pthread_create(&t[0], 0, Thread1, 0);
>> pthread_create(&t[1], 0, Thread2, 0);
>> pthread_join(t[0], 0);
>> pthread_join(t[1], 0);
>> return 0;
>> }
>>
>>
>>
>>
>> On Fri,...
2014 Apr 23
4
[LLVMdev] multithreaded performance disaster with -fprofile-instr-generate (contention on profile counters)
...t; 100000000; i++)
> foo();
> return 0;
> }
>
> __attribute__((noinline)) void bar() { v[999] = 66; }
>
> void *Thread2(void *) {
> for (int i = 0; i < 100000000; i++)
> bar();
> return 0;
> }
>
> int main() {
> static const int kNumThreads = 16;
> pthread_t t[kNumThreads];
> pthread_create(&t[0], 0, Thread1, 0);
> pthread_create(&t[1], 0, Thread2, 0);
> pthread_join(t[0], 0);
> pthread_join(t[1], 0);
> return 0;
> }
>
>
>
>
> On Fri, Apr 18, 2014 at 11:45 PM, Xinliang David...
2014 Apr 18
4
[LLVMdev] multithreaded performance disaster with -fprofile-instr-generate (contention on profile counters)
On Fri, Apr 18, 2014 at 12:13 AM, Dmitry Vyukov <dvyukov at google.com> wrote:
> Hi,
>
> This is long thread, so I will combine several comments into single email.
>
>
> >> - 8-bit per-thread counters, dumping into central counters on overflow.
> >The overflow will happen very quickly with 8bit counter.
>
> Yes, but it reduces contention by 256x (a thread