Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
2478 Discussions

Seeing the contents of a concurrent_hash_map?

djcouchycouch
Beginner
468 Views
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
468 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.


0 Kudos
Dmitry_Vyukov
Valued Contributor I
468 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.

0 Kudos
Dmitry_Vyukov
Valued Contributor I
468 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 :)

0 Kudos
Alexey-Kukanov
Employee
468 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 :)
0 Kudos
Reply