On 6/28/07, Giulio Cesare Solaroli <[EMAIL PROTECTED]> wrote:
> For the project I am working at (www.clipperz.com), I need to make the
> UI (all written in JavaScript) reactive even when performing some
> heavy (cryptographic) tasks.
>
> I was thinking about how to split the computation tasks of encrypting
> and decrypting using Deferred in order to be able to introduce some
> wait calls in order to avoid the "unresponsive script" warning of many
> browsers.
>
> Could Generators be of any help to my problem?

Hmm. They might be. But the threading aproach described in the link
you posted is sort of a all or nothing thing. You can split you're
long-running task into  a thread, but unless everything else your app
is doing is also in this kind of a thread, it won't run.

Also, these are cooperative threads. That means that your program has
to explicitly say "ok, I can be paused for a while now and let other
threads run". There's no preemption as in conventional threads, where
a scheduler will divide the time between the threads. So.. you really
have to program all of your application with this in mind.

Also, you have to be using js 1.7 to even consider generators, and
that limits you to Firefox 2.x only.

If you are willing to create that kind of a requirement on your
clients, Google Gears might be the perfect fit for your application:
http://code.google.com/apis/gears/
http://gears.google.com/

This is a browser extension that (among other things) allows you to
create real threads from javascript and run them asynchronously.

Arnar

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to