Multithreading

Many aspects of vvvv do support multi-threading, but it’d excellent if some of the spreadable nodes could be rewritten to work in parallel (especially animations and transformations).

The issue is that processors are not getting faster, they’re just getting more cores (and this looks like it will continue to be the case). Currently, there isn’t an effective method of making vvvv run faster by buying more hardware. I’d buy a quad core if I knew that vvvv would use it.

Could some nodes be rewritten with the new vvvv sdk to support multi-threading? Or does something need to happen in the vvvv core before multi-threading is possible? If they were rewritten with the sdk, then I presume that they’d need to be rewritten from scratch since the source isn’t available.

What do people think?
Spreaded nodes should be easy to parallelise. Would anybody be interested in working on recoding some of them?
Also where do people generally see their processing time being taken up (ignoring rendering time which is spent on the GPU)?

Many aspects of vvvv do support multi-threading, but it’d excellent if some of the spreadable nodes could be rewritten to work in parallel (especially animations and transformations).

imo, this would be too much work.

The issue is that processors are not getting faster, they’re just getting more cores (and this looks like it will continue to be the case). Currently, there isn’t an effective method of making vvvv run faster by buying more hardware. I’d buy a quad core if I knew that vvvv would use it.

do it, sooner or later you will benefit from it.

Could some nodes be rewritten with the new vvvv sdk to support multi-threading? Or does something need to happen in the vvvv core before multi-threading is possible? If they were rewritten with the sdk, then I presume that they’d need to be rewritten from scratch since the source isn’t available.

correct, thats the best approach. if you have a part of your patch, that consumes too much power, it makes perfect sense to write a custom node for that task. either you write all of your logic in the plugin and output just some transforms or you split it up into nodes of common use.
multithreading is quite easy in c#, there is an example in the particles plugin, see in the second half of the UpdateForce() function here after line 360.

if you wait for the threads to be finished with
myThread.Join();
it works without problems together with the vvvv mainloop.

What do people think?
Spreaded nodes should be easy to parallelise.

thats correct, a slicewise calculation is easy to parallelise. we could start some statistics, which nodes are used most often…hehe. i already made a patch, that makes some statistics out of a folder with patches…

Would anybody be interested in working on recoding some of them?

of course, but no time atm…

i imagine that a debug node called something referring to “performance hog” which outputs 1 spread of strings and 2 spreads of floats would be good.

strings: node name
float1: performance usage
float2: spread count

the difference between this and the ordinary debug mode is that all the nodes of one type would be categorised together as one item in this list, that way it’d be possible to see which nodes were the most intensive across all open patches and subpatches.

Also since the numbers are being outputted into vvvv, it’d be possible for users to build debug patches which automatically log or report the most intensive used nodes so that they can be optimised or worked around

sounds like a good proposal. would also maybe enable some kind of global (over all users) usage statistics, so optimization priorities would imo become clearer…

… if you want to multithread your own node, get a template here: http://vvvv.svn.sourceforge.net/viewvc/vvvv/plugins/c%23/_Samples/_PluginTemplateThreaded/trunk/