Page 1 of 1

is it possible for TWO max devices sharing memory

Posted: Thu Nov 08, 2012 12:24 pm
by TabSel
so, you store a number in device 1 and have access to this number in another device 2?

Re: is it possible for TWO max devices sharing memory

Posted: Thu Nov 08, 2012 1:05 pm
by broc
Yes, can easily be done with a [value] object.

Re: is it possible for TWO max devices sharing memory

Posted: Thu Nov 08, 2012 1:09 pm
by TabSel
Can you just briefly describe how?

Re: is it possible for TWO max devices sharing memory

Posted: Thu Nov 08, 2012 1:25 pm
by broc
Both devices need to have a value object with the same name, eg. [value mynumber].
Then you can set the value in device 1 and get the value in device 2.

For more details see help/ref file.

Re: is it possible for TWO max devices sharing memory

Posted: Thu Nov 08, 2012 2:05 pm
by TabSel
Thank you!

Confused with all the objects. You wrote value, I read number...

Re: is it possible for TWO max devices sharing memory

Posted: Sat Nov 10, 2012 1:18 am
by oddstep
yeah i've recently discovered you can do this with named coll objects. its great

Re: is it possible for TWO max devices sharing memory

Posted: Sat Nov 10, 2012 9:39 am
by pid
and works for [buffer~]'s too. but you have to be very careful with all these solutions.

different tracks will reside on different threads, and if you are not careful you might attempt to read a piece of data from one before the data has finished writing on another. which can cause big problems.

always manage your 'notifications' properly between data sharing. data sharing across a live set is not and not possible to be true 'real time'.

i always send a second notification saying 'has completed' to check before reading data elsewhere.

Re: is it possible for TWO max devices sharing memory

Posted: Sat Nov 10, 2012 9:47 am
by TabSel
But one device writing, one or more reading is thread save at least?
May be writing to queue in one device and constantly emptying the queue in the reading devices every 20ms or so will ensure ordering?