On 06/21/2017 Mike Lui wrote:
It appears the thread ids are reused. That is, if thread 2 exits, and another
starts, then thread 2 is reused.
Is there anyway to detect this during instrumentation, or is this a limitation
of the Valgrind tools?
When trying to separate the work of each thread, having VG_(get_running_tid)()
report non-unique ID's is troublesome.
C'mon. The tools re-use thread IDs because that is the easiest
and most efficient way to track the running threads.
If no re-use, then the next easiest way is to increment forever.
Then the threadID cannot be an 'unsigned short', and there must be
an adaptive hash table (or other non-trivial lookup mechanism)
from threadID to internal thread structure, and the hash table
must allow frequent deletions.
Modify the source to suit yourself. You will see how
un-worthwhile the modifications are for the existing use cases.
--
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users