CnC bug, collection_item.reset (with patch)

CnC bug, collection_item.reset (with patch)


I am looking at CnC since yesterday, I really like it, and the fact that It permits to concentrate on the concept of parrallelism, instead of fighting with synchro all over the place, but It seems that the API 0.8 have a bug on the function mentionned, as it implements the item_collection.reset() function like this:

template< typename Tag, typename Item, typename Tuner >
void item_collection< Tag, Item, Tuner >::reset()

But the base class item_collection_base declares the reset function to have boolean attribute (here the implementation):

template< class T, class item_type, class Tuner >
void item_collection_base< T, item_type, Tuner >::reset( bool dist )
#ifdef _DIST_CNC_
if( dist ) {
serializer * _ser = m_context.new_serializer( this );
(*_ser) & IC::RESET;
m_context.bcast_msg( _ser );

It can't compile... I suspect that some time ago, dist version was configured with the boolean, and that this boolean is an artefact that should be replaced by the define _DIST_CNC_ only,

Even if I do not use this reset function now, as I saw a post explaining the gc, there's definitively a bug here, that why the patch file I made to use the reset function successfuly is attached to the post.


Downloadtext/plain cnc-0.8.patch.txt5.19 KB
4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Jeff,
thanks for the bug report and the patch. Seems I have some homework to do...

Funnily I can compile, link and run our internal test-suite on Linux and Windows with gcc (4.2-4.7), icc nd VS2005-2010. Which compiler are you using? Does this happen with any code, even with the provided examples?


Hi Frank,


Which compiler are you using?

I'm using VS2010 Express with default Ms compiler:
> cl
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86


Does this happen with any code, even with the provided examples?

The provided examples does not use the incriminated function, so no, it does not happen with them :)

Ok. Thanks.
For shared memory your fix looks good, but it might not work correctly in distributed mode. I'll fix it for the next release (some time next quarter). Let me know if you need a "full" fix earlier.


Leave a Comment

Please sign in to add a comment. Not a member? Join today