Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Valgrind's cachegrind affected by multithreaded code?

If I run Valgrind cachegrind, will the results with one or more threads be different? Or Valgrind just sequentializes the program and only reports the work of one thread?

like image 383
Dervin Thunk Avatar asked Oct 06 '22 15:10

Dervin Thunk


1 Answers

Valgrind serializes all threads in an indeterminate fashion and analyses the sequential code flow. You will receive results about all your code, but the results may not be representative of an actual production run of the same code. (For example, many concurrency-related bugs will not manifest in a program that's run under Valgrind.)

like image 188
Kerrek SB Avatar answered Oct 10 '22 01:10

Kerrek SB