The Thread Manager, introduced in Firefox 3, offers an easy to use mechanism for creating threads and dispatching events to them for processing.
Only C++ code may use the thread manager and XPCOM thread. Application/Extension JavaScript should consider using a ChromeWorker instead.")
There are several interfaces that provide threading support:
nsIThreadManagernsIThreadnsIThread interface encapsulates an operating system thread, providing easy cross-platform access to multithreading in your code.nsIThreadPoolnsIThreadInternalnsIThread that is implemented by the XPCOM thread object to add support for observing dispatch activity on a thread.nsIThreadObservernsIThreadEventFilternsIThreadInternal.pushEventQueue() method in nsIThreadInternal to allow event filtering.nsIRunnable