On 9/4/06, Umesh Bywar <[EMAIL PROTECTED]> wrote:
Hi all:

    I have an application where I need to create threads from JavaScript
component. I tried using nsIThread, but I am facing some problems with it.
When I create a number of threads, mozilla hangs at some point of time. I am
trying to find out the reason. Meanwhile, if anybody can suggest some other
alternative to nsIThread, then that will be really helpful.
    Thanks.

You have to be very careful when writing threaded code, especially in
JS. You shouldn't access any non-threadsafe objects (DOM, in
particular) from outside the UI thread. A debug build might help
tracing the cause of your hangs.

There is no alternative for true threaded code, but you can break your
work in smaller parts and chain them via setTimeout in the UI thread.

Nickolay
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to