Strands in JavaScript

View: New views
1 Messages — Rating Filter:   Alert me  

Strands in JavaScript

by Charles Jolley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Sorry if this has been covered already, but I'm curious if this list  
has considered something like co-routines for a future version of ES.  
An example implementation of the concept (I'm not sure of the quality)  
is here:

http://www.xucia.com/strands-doc/index.html

Properly implemented, it seems that co-routines might offer a better  
way to handle concurrency in the browsers than threads or web-workers  
for a number of reasons:

1. Since browser app are essentially event driven, the biggest problem  
with long running calculations in JS is that it block the browser  
event handling.  Co-routines offer an easy way around this as a long  
running task can be stopped and restarted later without losing context.

2. Properly designed, co-routines can form the foundation of a  
scheduling library along the lines of Grand Central Dispatch which  
would ultimately allow a browser engine to pawn off multiple CPU cores.

Most importantly, my experience with co-routines is that it makes  
harder event-driven style of programming to act more straightforward.

-Charles

_______________________________________________
es-discuss mailing list
es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss