[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] Web Workers and ArrayBuffers?
- To: Kenneth Russell <email@example.com>
- Subject: Re: [Public WebGL] Web Workers and ArrayBuffers?
- From: Shy Shalom <firstname.lastname@example.org>
- Date: Tue, 12 Apr 2011 20:17:54 +0300
- Cc: webgl public <email@example.com>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=/COiRt0YQJGqkpRoKgHpEL09KARehNttGXIK3TTQtyE=; b=FaIkOSeue5jbIvtkRxinw1/IoKsThNV2XdG7wTL6Ha/QeRXTN9hUIR8JmWw2EtJotU 8RHRlCjQ+9XyiKeb3QLbd9SLlGsgLkAhyhJLG4DtRf7JMqjzObq8pe/lhyjbCz8cLn9J jvLfDluDxtkDhfHE9qRrVnL+tU9beTS9KcG2U=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=UnWNesASVeIiZDAfcuAuQNYOIwgQp/Ro/bjj/KDMlR3wFxStXivXyfto7pXn/WNeqG o7eVAxgcxfp/5SI035vzfjzuU/21H7Tf94lr+ImfrxbgEWElLNPT6CHAtYKaPfzpEzdY gYo/zarhQZwQnZowJkrLVZFN2k1PVeT5aATXQ=
- In-reply-to: <BANLkTimD2T_CXT2Jr_PTFqkVHdUGSM0kCQ@mail.gmail.com>
- List-id: Public WebGL Mailing List <public_webgl.khronos.org>
- References: <BANLkTi=i=zvWdtRzvwf-DQiZAZX-W7+_Rw@mail.gmail.com> <BANLkTimD2T_CXT2Jr_PTFqkVHdUGSM0kCQ@mail.gmail.com>
- Sender: firstname.lastname@example.org
Using Chrome 10.0.648.204
This actually already works well on Firefox. the typed array are preserved in the received object.
So I only need to add a check for Chrome.
There's this bug report about it -
Why is there a need for a revision to the typed array spec? (not that it really bothers me)
Another note - Firefox also seems to be stricter about which objects it agrees to post . If the posted object contain functions, an exception is
thrown. The same postMessage goes through without error in Chrome. Not
sure if that's a bug or a feature.
On 12 April 2011 20:07, Kenneth Russell <email@example.com>
What browser and version are you using?
We are about to start revising the Typed Array specification to define
the behavior of passing ArrayBuffers and typed array views between the
main thread and worker threads. The new behavior will be zero-copy,
and if you ping-pong the ArrayBuffers back and forth, you'll be able
to implement really efficient producer-consumer queues.
These changes will be discussed on this list as they show up, and
hopefully you'll see this behavior start to appear in nightly builds
of browsers within a couple of months.
On Tue, Apr 12, 2011 at 4:41 AM, Shy Shalom <firstname.lastname@example.org
> I'm trying to write a Worker thread that does some processing and creates a
> mesh on the fly.
> It works fine up until returning the created result to the main GUI thread.
> it seems that the communication between the worker and the main thread does
> JSON serialization,
> so if I'm sending a Float32Array from the worker, what I get in the main
> A trivial solution is to just rebuild the Float32Array again from the array
> I receive but that seems wasteful.
> Is there a good workaround for this? Maybe a way to tell the JSON
> deserialization that something should be a Float32Array ?