|
From: William G. <app...@li...> - 2016-02-07 03:22:37
|
Thanks for your response I. Very helpful slides. As a follow up question is it possible to use thread local storage in a valgrind tool? ________________________________ From: Ivo Raisr <iv...@iv...> Sent: Saturday, February 6, 2016 5:33:36 AM To: William Good Cc: val...@li... Subject: Re: [Valgrind-developers] Using lock in tool 2016-02-06 5:07 GMT+01:00 William Good <app...@li...<mailto:app...@li...>>: The table needs to be thread safe because different threads will be using it at run time. I cannot use a pthread_mutex in my tool, correct? How can I make a lock for the table? Hi Bill, Valgrind runs properly multi-threaded applications, but effectively only uses one vCPU at a time to run them. In other words, Valgrind does not use multiple CPUs when running a multi-threaded application. So far no Valgrind analysis tool (except 'none') is designed such that it is multi-thread safe. They all leverage the fact there is always single thread running. See Philippe's presentation about multi-thread Valgrind prototype from FOSDEM 2015: https://archive.fosdem.org/2015/schedule/event/valgrind_multi_prototype/ It goes to a great length in what and where is not multi-thread safe and how come Valgrind is able to run multi-thread applications properly. An ideal situation would be if Valgrind core provides efficient synchronization mechanisms which all analysis tools can consume. Maybe Philippe could comment if there is anything usable from his prototype. I. |