Switching a spread in a node's output


is it possible to ‘replace’ an output spread in the Evaluate() function, in order to make it faster?

Right now I am setting every slice of a spread to a new value, but I already have all the values at that time, so simply pointing the output to another spread that has already been filled elsewhere, would speed up the time needed for Evaluate() to finish tremendously.

Can this be done?

The following doesn’t seem to have an effect on the output pin:

FTestOut = selectSpread ? receivedSpreadB : receivedSpreadA;
selectSpread = ! selectSpread;

Can’t you use the output spread in the first place?

The data will be updated from another thread, and I don’t suppose Spreads are thread-safe, so I would like to pre-create a spread in that other thread, and then tell vvvv’s main thread “now use this one”.

The only place I could change the output spread safely, is in the Evaluate() function, I guess.

Or is there another way?

there is a _ISpread_member method named AssignFrom().


but that will actually copy all of the values, instead of assigning a new already existing spread to the output pin. So that’s basically the same as writing my own ‘copy-every-slice’ code.

maybe the pointer classes in