[Project_owners] Long XSLT Transformations, UI blocking

Didier Ernotte didier at ernotte.com
Tue May 10 15:47:42 EDT 2005


Hi,

This is not an answer... just my 2 cents to say that I have exactly the
same problem with my extension. I have tried the nsIThread interface,
without any success (FF hangs), just like you. For some code, I have
succeed using the window.setTimeout to create a pseudo thread, but
basicaly, the javascript engine is not multithread. What I have read is
that thread could be implemented with XPCOM object is C++ or anything
else but javascript.

Didier

--- Stan James <sjames at uni-osnabrueck.de> wrote:
> Hi,
> 
> My extension occasionally needs to execute some big XSLT
> transformations 
> which can take up to 30 seconds or so. It's really annoying for the 
> users to have the UI blocked during this time.
> 
> I had no luck with sticking the transformation in it's own window,
> and 
> my attempts at Threading just hang the browser. (And looking at past 
> posts in this list, perhaps threading is impossible without XPCOM.)
> I'm 
> now wondering if I could launch a separate, temporary, instance of 
> Firefox to handle the transformation.
> 
> Does anyone know of any better tricks to get around this? Any way to
> do 
> the transformation asynchronously?
> 
> Thanks!
> -stan
> 
> 
> ps For what it's worth, here's the non-working threading code:
> function threadTest()
> {
>    dump("hi\n");
> }
> threadTest.prototype = {  go: function ()
>  {
>      dump("starting thread\n");
>    const nsIThread = Components.interfaces.nsIThread;
>    var thread = 
>
Components.classes["@mozilla.org/thread;1"].createInstance(nsIThread);
>    thread.init(this, 0, nsIThread.PRIORITY_NORMAL,
>                nsIThread.SCOPE_GLOBAL,
>                nsIThread.STATE_JOINABLE);
>  },
>  // nsIRunnable
>  run: function ()
>  {
>    dump("\n*** RUNNING THREAD\n");
>  }
> };
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
> 
> 
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
> 


More information about the Project_owners mailing list