Closed Bug 389592 Opened 17 years ago Closed 17 years ago

thread-safe alert()

Categories

(Core :: DOM: Core & HTML, enhancement)

x86
Windows XP
enhancement
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: eyalroz1, Unassigned)

Details

I wish I could use alert() from a thread other than the main UI one. I don't care if it would make all threads wait for the 'ok' click, I don't care whether it's done by proxying or any other way - I just want to have alert() do something reasonable (other than triggering a hang, which is what currently happens).
The DOM is not threadsafe by design. You shouldn't be using threads from DOM code period.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → WONTFIX
Ah, but I'm not using threads from 'DOM code' (at least, not according to what I think is DOM code). The only exception to this is the fact that I want my threads to be able to trigger an alert().
Any JavaScript that runs in the context of a page (XUL/HTML/whatever) is DOM script: that is, the global object is the DOM window, and therefore it is not safe to run any threaded code in that context.
But it is (mostly) safe, at least from my experience, provided your thread doesn't do anything related to the UI. I used a separate thread to search mail folders for duplicate messages (http://removedupes.mozdev.org/) .
then you just happened to be lucky... that's not designed to work and often won't work.
Component: XP Miscellany → General
QA Contact: brendan → general
Component: General → DOM
QA Contact: general → general
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.