Simon,

To rationale behind Andreas' answer is that v8 implements a virtual machine 
and by definition the only way to move data into or out of it is 
copy-in/copy-out through a v8 interface.  Using native a plug-in that 
defeats the isolation of a v8 isolate will only break design assumptions in 
v8.

An off-heap buffer can be allocated and accessed from inside v8, but 
referencing that memory from within a JS program requires buffer access 
methods (Buffer Node.js v0.10.26 Manual & Documentation) limiting you to 
scalar types.  In practice, these operations result in copying the data 
from the buffer to the v8 heap anyhow, ultimately zero-copy in v8 is nearly 
impossible.

I wrote a native Node addon (https://www.npmjs.org/package/ems) that 
combines synchronization primitives with shared memory, it also depends on 
copy-in/out, and because it's a native plugin it deoptimizes code that uses 
it.  Nevertheless, it's still capable of millions of atomic updates per 
second, far better than is possible with messaging.

             -J


On Tuesday, April 22, 2014 9:54:16 AM UTC-7, SimonHF wrote:
>
> For example, I can get a uint like this in a C++ function: uint32_t 
> myuint32 = args[0]->Int32Value();
>
> But is it also possible to change the value somehow from C++ land, so that 
> in javascript the variable passed into the function will reflect the 
> changed value?
>
> If this is possible with some C++ argument types and not others, then 
> which types allow modification?
>
> Thanks.
>

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to