views:

178

answers:

1

Does anyone have information about using Causalities? I have tried unsuccessfully to use these on my project as they appeared to be causing massive memory loads.

Is this unusual?

Beyond the normal (aka overly simple) examples given in the documentation, there isn't a heck of a lot of information about using Causalities in CCR code.

I can't give any code examples per-say as I ripped the Causalities out and replaced with more conventional exception handling (not conventional in CCR though!)

+2  A: 

I've only recently started looking at them, so I can't offer much advice, but I'll offer what I can:

  1. Check whether you have any cycles in your code - is it possible that a causality is getting spawned again and again? An example of this is where you create a new causality and post a message to another component which (ultimately) posts back to your component causing the original task to run again, so the causalities 'stack' on one another. One way to do this is check ActiveCausalities before you add your new one.
  2. Did you consider trying to explicitly remove the causality at the end of the same scope where you added it?
  3. Apparently DSS uses causalities extensively, so that if there were genuinely a leak, then you'd think they'd have found it.
  4. Agreed, there aren't enough samples on this topic, so it's difficult to know what the best practice is without trying to understand the implementation.


Check this post out. It suggests that you want to automatically remove the causality at the end of the scope you added it.

Nick Gunn
I think I have a long way to go with learning the CCR best practices/patterns
Harry