Isn't that what .view.slice does? Daniel Armak
On Thu, Jun 5, 2014 at 4:34 PM, √iktor Ҡlang <[email protected]> wrote: > Hi, > > This sounds plausible to me: > > Create an interface that wraps a section of the float array and pass an > instance of that section into the actor when it is created (carefully > making sure that you do not have any overlapping sections handed out). > > > On Thu, Jun 5, 2014 at 3:22 PM, Marco Luca Sbodio <[email protected]> > wrote: > >> Hello everyone, >> >> after having thought for some time about this problem, I can't find a >> good solution, and so I decided to ask for help. >> >> I essentially have a large (multi-dimensional) array of numbers (float), >> that is the result of some computation. I would like to have a clean, safe >> and efficient way to enable multiple actors to read elements and/or slices >> of this array (obviously without having to create a copy of the array in >> each actor). What is the best/recommended way of doing this? >> >> I can of course have an actor that "contains" that array as a private >> field, and respond to messages such as GetValueAtCoodinates(...) or >> GetSlice(...). However, messages of type GetValueAtCoodinates(...) don't >> seem a good idea, because I would end up having millions of this messages >> from actors requesting values from my array. On the other hand messages of >> type GetSlice(...) would require me to copy the requested slice in an array >> that is passed back as answer: I can use System.arraycopy(...) but it seems >> kind of a overhead, especially considering that all my actors will access >> this array in read-only mode! >> >> I've also read about Agents, but an Agent doesn't seem to be a good idea >> in my case, because an array is obviously mutable (though I know that my >> agents will not mutate it) >> >> So, I'm not sure what's the best way of achieving what I need. >> >> Any help is highly appreciated! >> >> Best Regards, >> Marco >> >> -- >> >>>>>>>>>> Read the docs: http://akka.io/docs/ >> >>>>>>>>>> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user >> --- >> You received this message because you are subscribed to the Google Groups >> "Akka User List" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/akka-user. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Cheers, > √ > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: > http://doc.akka.io/docs/akka/current/additional/faq.html > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
