Re: Workers

On Sat, 19 Jul 2008, Andrew Fedoniouk wrote:
>
> May I propose to add to the document something like this?
> 
> 1. Introduction. [...]

Yes, a detailed introduction will be written, with examples and so forth, 
in due course.


> > On the backend it is certainly the case that implementations will have 
> > to be very careful in their coding. This is independent of the Workers 
> > spec, though.
> 
> By Workers you introduce new entity - shared access to the same objects 
> local data storages and databases. I think we should mention that DB or 
> local storages are being manipulated in exclusive mode - if DB is open 
> by one Worker or main thread then it is not available by any means in 
> other threads. That will simplify life.

This would also lead to deadlocks or unexpected failures of Web author 
code, which is far worse than making implementations harder.

Implementations already have to deal with this anyway, since multiple 
pages from the same domain can access the same database at the same time.


> > > What about such attribute as event.target? It is DOM object usually. 
> > > Or event.source? If yes then what prevents Worker to store it and to 
> > > manipulate DOM or window from second thread?
> > 
> > event.target is whatever the Event it. In the case of a MessagePort, 
> > the target is the MessagePort. event.source is always null. I don't 
> > really understand what you are asking here.
> 
> It is not clear why you need DOM Event in this case then. [...] If DOM 
> is isolated then it is isolated completely. No objects implementing any 
> DOM interfaces must be available. Otherwise it will be nightmare for 
> implementors.

We need DOM Events because they are the event structure of the Web. They 
are separate and distinct from the DOM Core's Node objects.

Inventing our own parallel eventing construct would just be duplication of 
effort without benefit, as I ses it.


> Messages here are arbitrary JSON objects as far as I understand.

JSON is a serialisation, I'm not sure what you mean by this. There's no 
serialising going on here.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Sunday, 20 July 2008 00:01:04 UTC