[Sugar-devel] [sugar-web] do webkit frames run on different threads?

Daniel Narvaez dwnarvaez at gmail.com
Thu Dec 19 10:28:47 EST 2013


I know that webkitgtk is currently single web process, they are working to
make it one process per web view, but not per frame afaik. In the blink
announcement google mentioned they wanted to go one process per frame,
which was not possible to do with webkit. I don't really know if single
process is necessarily single thread here.

Can you explain where multi thread would be an issue in our code? Why I'm
thinking perhaps simplistically is that we are already dealing with the
window.sugar stuff being available asyncronously.

On Thursday, 19 December 2013, Code Raguet wrote:

> I've read the following, recently:
> [...]
>
>> In Opera, every window has its own JavaScript thread. This includes
>> windows in iframes. The consequence is that event handlers initiated from
>> different frames might execute at the same time. If these simultaneous
>> scripts modify shared data (like properties in the top window), we have the
>> possibility of race conditions.
>
> [...]
> source:
> http://dev.opera.com/articles/view/timing-and-synchronization-in-javascript/
>
> Because some pieces of sugar-web API ( for ex: env.js) relay on window.top
> props (and karma loads a context.html iframe and runs the specs within), I
> asked to myself if webkit frames may simultaneously run on different
> threads...
>
> I always think in a single-threaded model when programming javascript
> (async, of course, but not multithreading). Therefore, It seems to me like
> an Opera specific.
> After a little research, I wasn't able to find an concrete answer, so
> asked Roger to try out some tests.
>
> We made a long running function with busy waiting loops that mutates a
> shared porp at window.top and then we ran it twice (one per frame) in
> Opera. As the doc says, we 've been able to make a (racy) non-deterministic
> state of the shared prop.[?]
>
> Same tests on Chrome showed single-thread behavior... [?]
>
> So the thesis would be running those on webkit... but we haven't yet
> We had some unrelated issues and before keep digging I want ask you what
> do you think/know about...
>
> Thanks,
> Code
>


-- 
Daniel Narvaez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20131219/26707490/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 328.png
Type: image/png
Size: 569 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20131219/26707490/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 341.png
Type: image/png
Size: 610 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20131219/26707490/attachment-0001.png>


More information about the Sugar-devel mailing list