- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[bash]concurrent_unordered_mapComponents; struct UpdateComponents { float Data; UpdateComponents(float delta_t): Data(delta_t) {}; void operator() (concurrent_unordered_map ::range_type& range) const { for (concurrent_unordered_map ::const_iterator iter = range.begin(); iter != range.end(); ++iter) { iter->second->update(Data); } } }; void ComponentManager::updateComponents(float delta_t) { task_scheduler_init init; if (delta_t > 0.0f) { // Update the components parallel_for(Components.range(), UpdateComponents(delta_t)); } } [/bash]
This code sits in a DLL that the already threaded application calls. With a single threaded test application I don't have any issues, just when the DLL is with the target application. I must be missing something somewhere and I have been combing through the documentation. Any help is appreciated, thank you.
(note: the code above is littered with 'lt' and 'gt' and not '<' and '>')
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Then see if the next call to your DLL, after establishing your application thread team, succeeds or fails
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It wasn't TBB that was the problem, but the metadata that is read in from an XML file forconstructing the ComponentInstance objectsthat was different from the test data.
Strange that the crash happened within a TBB function call whenit was really a null pointer in the simulation. The stack trace showed no indication of this. The way that I found it was to comment out the parallel_for calls and iterated across the containers in the'ye olde fashioned' way and found the culprit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I saw your other post for the work around.....
However regarding my earlier response
// yourProgram.cpp
...
int main(int argc, int argv[])
{
yourFunctionToInitializeTBBandRunBogus_parallel_for();
...
someCallTo3rdPartyGameEngine());
...
yourTBBcodeContainingCallsToSome3rdPartyGameEngine());
...
}
You do not need the sources to the 3rd party library
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Jim, I probably wasn't too clear in my post. The work around was for easier debugging (unable to view the data in the concurrent_unordered_map in quick view (VS 2008)). The problem was a malformed object, we fixed the data and have the concurrent methods back in there and everything isworking fine now.
Also, the game engine is where the main() function resides, our DLL is accessed through a game engine DLL: GameEngine.exe -> GameServer.dll -> Our.dll. OurDLLjust sends and receives messages from the server dll and does its own work on our data.
Again, thanks for responding to the thread!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page