W3C home > Mailing lists > Public > public-html@w3.org > July 2008

Re: Workers

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Tue, 22 Jul 2008 00:05:14 -0700
Message-ID: <488586AA.4050403@terrainformatica.com>
To: Justin James <j_james@mindspring.com>
CC: 'Ian Hickson' <ian@hixie.ch>, public-html@w3.org

Justin James wrote:
> 
>> -----Original Message-----
>> From: public-html-request@w3.org [mailto:public-html-request@w3.org] On
>> Behalf Of Andrew Fedoniouk
>> Sent: Monday, July 21, 2008 5:16 PM
>> To: Justin James
>> Cc: 'Ian Hickson'; public-html@w3.org
>> Subject: Re: Workers
>> Problem with data URLs is also in the fact that they are almost not
>> usable for using  in static
>> HTML document. For dynamic, generated html  they are probably fine but
>> when attribute value spans
>> three pages is not to be read by human.
>>
>> I understand motivation of having Worker script to be placed in
>> separate
>> documents/files.
>> It appears as this is the only way to avoid execution of the script in
>> main thread. It has to live in
>> separate document. Not perfect of course as it brings some uncertainty
>> in the algorithm - when it will really
>> start and will it start at all?.
> 
> I can see why this makes sense, but I find it hard to believe that browser
> vendors cannot build a thread system into their JavaScript interpreters that
> does this sensibly, without needing to use a separate document. They can
> download files in a separate thread, I am not sure why they can't have a
> multithreaded JavaScript system too.

Well, as an author of two JS alike languages/engines (+ one JVM if it 
counts), e.g. [1], I can tell you that JS execution model is not quite 
suitable for real multitasking. Probably the best what you can get is
so called "green" threads. But that is pretty much cooperative
multitasking.

I think that proposed solution with separate isolated VM is the most
reasonable at this point. Usually it will be just one or two Workers
running at the same time so this machinery will work. If it is really 
needed of course.

> 
>> UA usually have some cap on how many simultaneous connections can be
>> used by http client.
>> And yet "A single-user client SHOULD NOT maintain more than 2
>> connections with any server or proxy. " [1]
>> In case of Workers UA shall use some intrinsic limit too. I think it is
>> enough for createWorker() to throw
>> an exception if allowed maximum is reached.
> 
> Yeah, I forgot about the 2 download cap as well, I am curious if that would
> be waived for workers or not.
> 

UAs these days are so smart that silently extend this limit so it is not 
2 but, say, 8 in reality. Particular value is not relevant but limit is 
there.

I think that problem is in lack of some structural data delivery format.
Similar to JAR(zip) file in Java. In principle it is way easier to
package 10 script files into one zip file and download it as one chunk
rather than requesting 10 different files. Even those files are in cache
already it is still a lot of work.

-- 
Andrew Fedoniouk.

http://terrainformatica.com

[1] TIScript : http://code.google.com/p/tiscript/
Received on Tuesday, 22 July 2008 07:05:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:19 GMT