Thank you very much. May I ask a few more questions?

1. What is the difference between v8 object heap and C runtime heap? I've 
thought V8 GC is for v8 object heap. Is there another garbage collector?

2. I am currently thinking of implementing thread spawning & joining 
routines within Crankshaft-generated code snippet. Does GC happen within 
Craftshafted code, or it stops Crankshafted code and resumes it afterwards? 
If it's the latter, I suppose I may not need to worry about GC, right?

3. I read your page (http://syntheticsemantics.com/EMS.js/), and it looks 
like your objective was similar to mine. You spawn multiple threads to 
execute a loop in parallel. How does the use of Node.js's fork feature 
eliminate all the showstoppers you mentioned? I don't have any knowledge 
about Node.js itself, so some explanation would be very helpful.

Thank you!

On Saturday, February 27, 2016 at 5:10:50 PM UTC-5, 
[email protected] wrote:
>
> There are multiple levels of garbage collection (v8 object heap and C 
> runtime heap) that are not thread-safe.  Furthermore, you'll need to 
> implement some kind of language extension so programmers can indicate which 
> loops should execute in parallel, as well as some kind of synchronization 
> (ie: mutexes) or atomic read-modify-write (ie: CAS, FAA) operations to 
> implement thread safe access of global variables.
>
> Assuming you solve those problems, you then face the challenge of finding 
> enough parallel work to amortize the overhead of scheduling, 
> synchronization, and load imbalance.  Remember Amdahl's law 
> <https://en.wikipedia.org/wiki/Amdahl%27s_law> -- if a program spends 15% 
> of it's time in initialization orchestrating parallel work and distributing 
> data to tasks, and 15% of it's time collecting and outputting the results, 
> that program cannot even reach a 4x speedup.  To achieve good parallel 
> efficiency, single iterations must take long enough to amortize the 
> overhead, which effectively eliminates any kind of fine-grained 
> parallelization, which eliminates the need to implement parallelism 
> *inside* v8.
>
>                 -J
>
>
> On Friday, February 26, 2016 at 4:07:35 PM UTC-8, Tiny Wings wrote:
>>
>> Thank you very much for your answer.
>> Could you let me know what those showstoppers are?
>> And I don't have any experience with Node and I'm not intending to build 
>> a web server either. Is Node easier to use than native V8 for 
>> parallelization?
>>
>> Thank you.
>>
>> On Tuesday, February 23, 2016 at 1:31:55 PM UTC-5, 
>> [email protected] wrote:
>>>
>>> I, too, looked at adding OpenMP to v8 but there are several showstoppers 
>>> to adding parallelism *inside* v8.  My solution was to add shared, 
>>> persistent objects as a native addon, and fork multiple instances of Node 
>>> for concurrency.
>>>
>>> The native addon prevents this from being used in browsers, but this 
>>> approach works embedded in systems with POSIX-like shared memory: EMS.js 
>>> home page <http://syntheticsemantics.com/EMS.js/>, GitHub 
>>> <https://github.com/SyntheticSemantics/ems>
>>>
>>>           -J
>>>
>>>
>>> On Monday, February 22, 2016 at 11:34:38 PM UTC-8, Tiny Wings wrote:
>>>>
>>>> About my question:
>>>> This is actually not really much about parallelization; this is rather 
>>>> about how to do launch multiple threads in multiple cores within a 
>>>> javascript program and make them communicate when needed.
>>>>
>>>

-- 
-- 
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