Re: [v8-users] gc and threading

2019-05-20 Thread 'Peter Marshall' via v8-users
If you block the main thread at a safe time (e.g. not during GC) then you can probably access heap objects from your other threads without handles as long as you do your own synchronization between the background threads. Not sure how concurrent marking threads from the GC will feel about that t

Re: [v8-users] gc and threading

2019-05-17 Thread Ledion Bitincka
>You could read from the heap on a concurrent thread but there is no synchronization when writing to the heap from the main thread My current thinking is something like this - ie I'd be blocking in the main thread until the serialization is done in main thread: handles[] = getHandlesToSerializ

Re: [v8-users] gc and threading

2019-05-16 Thread 'Peter Marshall' via v8-users
On Wednesday, May 15, 2019 at 9:09:18 PM UTC+2, Ledion Bitincka wrote: > > Thanks! > > > While I understand that this is tempting, please be aware that only one > thread may be active in one Isolate at any given time. > I was hoping that there could be multiple threads that had "read-only" > acc

Re: [v8-users] gc and threading

2019-05-15 Thread Ledion Bitincka
Thanks! > While I understand that this is tempting, please be aware that only one thread may be active in one Isolate at any given time. I was hoping that there could be multiple threads that had "read-only" access to an Isolate's heap - I was looking through how ValueSerializer works and now

Re: [v8-users] gc and threading

2019-05-15 Thread Jakob Kummerow
> > I'm trying to improve some serialization code in NodeJS and was wondering > if this could be achieved by going down to the native code and using > multiple threads to parallelize the serialization of multiple objects. For > example, imagine we need to serialize 1K objects to JSON/OtherFormat -

[v8-users] gc and threading

2019-05-15 Thread Ledion Bitincka
I'm trying to improve some serialization code in NodeJS and was wondering if this could be achieved by going down to the native code and using multiple threads to parallelize the serialization of multiple objects. For example, imagine we need to serialize 1K objects to JSON/OtherFormat - split