Community
cancel
Showing results for 
Search instead for 
Did you mean: 
djcouchycouch
Beginner
41 Views

Seeing the contents of a concurrent_hash_map?

Hi,

There doesn't seem to be a way for seeing the actual contents of a concurrent_hash_map in a watch window when debugging in Visual Studio. Is there a way to do this?

At the moment, our solution is to iterate through it and manually dump the contents into a plain jane std::vector, but obviously it's not an optimal one.

Thanks!
0 Kudos
4 Replies
robert_jay_gould
Beginner
41 Views

Quoting - djcouchycouch
Hi,

There doesn't seem to be a way for seeing the actual contents of a concurrent_hash_map in a watch window when debugging in Visual Studio. Is there a way to do this?

At the moment, our solution is to iterate through it and manually dump the contents into a plain jane std::vector, but obviously it's not an optimal one.

Thanks!

That's the same thing I've been doing, just remember that iteration isn't thread safe, so you need to lock the entire container previous to iteration.

Anyways TBB's concurrent vector, and other containers are just about as hard to debug. The issue is the data decomposition that isnecessaryto avoid access conflicts make debugging hard. Adding the extra debugging information should be possible, but it'll likely place a fairly large penalty on performance and concurrency...

So back to theiterationsolution, try to make dumping an on demand operation, not something your program does constantly. I basically use an RPC call into the application which will dump only the data I need, that way I can schedule the performance bumps.


Dmitry_Vyukov
Valued Contributor I
41 Views

Quoting - djcouchycouch
Hi,

There doesn't seem to be a way for seeing the actual contents of a concurrent_hash_map in a watch window when debugging in Visual Studio. Is there a way to do this?

At the moment, our solution is to iterate through it and manually dump the contents into a plain jane std::vector, but obviously it's not an optimal one.

Thanks!

You may setup any representation for any data type you want in the following file:
MSVC_PATHCommon7PackagesDebuggerautoexp.dat
There is some silly documentation about the format inside the file itself, find more info elsewhere.

Dmitry_Vyukov
Valued Contributor I
41 Views

Quoting - Dmitriy Vyukov
You may setup any representation for any data type you want in the following file:
MSVC_PATHCommon7PackagesDebuggerautoexp.dat
There is some silly documentation about the format inside the file itself, find more info elsewhere.



It would be nice if TBB distribution will include autoexp.dat file supporting TBB data types.
Yes, I know what you will say, I know where to submit contributions :)

Alexey_K_Intel3
Employee
41 Views

Quoting - Dmitriy Vyukov
It would be nice if TBB distribution will include autoexp.dat file supporting TBB data types.
Yes, I know what you will say, I know where to submit contributions :)

I suggest you to submit a feature request :)
But if someone wants it sooner, then yes, make a contribution :)
Reply