- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Class finish_reduce that has_right_zombie will not call the destructor of the contained body object if the join operation throws.
From parallel_reduce.h:
[cpp]if( has_right_zombie ) {
// Right child was stolen.
Body* s = zombie_space.begin();
my_body->join( *s );
s->~Body();
}[/cpp]
Clearly s->~Body() will not be called when my_body->join( *s ) throws. I propose:
[cpp]if( has_right_zombie ) {
// Right child was stolen.
Body* s = zombie_space.begin();
try{
my_body->join( *s );
s->~Body();
}catch(...){
s->~Body();
throw;
}
}[/cpp]
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually, I remembered that I had submitted essentially the same bug but with respect to cancellation. The solution proposed here: http://software.intel.com/en-us/forums/topic/329081 is better.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page