[Webkit-unassigned] [Bug 53485] Web Workers' shared memory

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 1 05:06:44 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=53485





--- Comment #1 from Gabor Loki <loki at webkit.org>  2011-02-01 05:06:44 PST ---
Created an attachment (id=80742)
 --> (https://bugs.webkit.org/attachment.cgi?id=80742&action=review)
proof of concept shared memory

I have a patch which shows a proof of concept shared memory feature for workers. The patch is not complete, but it shows what we can achieve with shared memory. I am going to attach an simple example which shows the performance differences between the message-passing and shared memory communication. My measurement was that the communication with shared memory more than 20-30 times faster on x86 and on ARM as well.

The current patch has the following features:

 * create a worker with shared memory

   // create a worker where the 'size_of_shared_memory' is the size of shared memory region in bytes.
   new Worker("worker-file-name.js", size_of_shared_memory);

 * access the shared memory from the main and the worker thread

   // fill the shared memory from the 'initial_pos' offset
   // with the content of 'uint32Array' which is an Uint32Array
   worker.setUint32Array(initial_pos, uint32Array);

   // create an Uint32Array which contains 'number_of_elements' elements
   // from the 'initial_pos' offset of shared memory
   var array = worker.getUint32Array(initial_pos, number_of_elements);


Well, as I said this is a proof of concept patch. So, I have a list of issues, which should be addressed before landing. If anyone is interested in this topic and wants get involved, please share your thoughts! I would really appreciate it ;)

Here is my todo list:
 * add more get/set methods for shared memory region (such as getUint8Array, etc).
 * if the workers live in processes, we should use the shared memory of the host system as a shared memory region for workers.
 * design a common class/structure which can be passed to the workers from the main process for both thread- and process-based workers.
 * ensure Shared Web Workers work as expected.
 * propose as an extension for the standard of Web Workers at W3C ;)

What is your thoughts about the concept of workers' shared memory?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list