I have a general question regarding ‘Multitreading’ in a C# component.
In one of my recently-developed plugin components I’ve replace some ‘for loops’ with the ‘parallel.For loop’ alternative using information that I’ve found on the following webpage by James Ramsden: http://james-ramsden.com/multithreading-a-foreach-loop-in-a-grasshopper-components-in-c/
This seems to work great as you can see my component speed is several orders of magnitude faster now: (This example was performed on a pc with 24 cores)
So now my question: What are the differences / disadvantages comparing this techniques with the ‘IGH_TaskCapableComponent’ interface. Information here: https://developer.rhino3d.com/guides/grasshopper/programming-task-capable-component/
Should I remove the component that is single threaded from my plugin with release? Or will some users prefer not to use multithreading? Should I combine both and use ‘AppendAdditionalComponentMenuItems’ to let the user decide. Or should I look further into making a TaskCapableComponent.
Thanks in advance for any comments!