The Thread Manager, introduced in Firefox 3, offers an easy to use mechanism for creating threads and dispatching events to them for processing.
There are several interfaces that provide threading support:
nsIThread interface encapsulates an operating system thread, providing easy cross-platform access to multithreading in your code.
nsIThread that is implemented by the XPCOM thread object to add support for observing dispatch activity on a thread.
nsIThreadInternal.pushEventQueue() method in
nsIThreadInternal to allow event filtering.