Dervin Thunk
Dervin Thunk

Reputation: 20140

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?

Upvotes: 5

Views: 684

Answers (1)

Kerrek SB
Kerrek SB

Reputation: 477494

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.)

Upvotes: 4

Related Questions