Closed
Bug 504034
Opened 16 years ago
Closed 16 years ago
RgnRectMemoryAllocator fails thread-safety assertions even when used only on non-main thread
Categories
(Core :: Graphics, defect)
Core
Graphics
Tracking
()
RESOLVED
FIXED
People
(Reporter: cjones, Assigned: cjones)
References
Details
Attachments
(1 file, 2 obsolete files)
|
4.21 KB,
patch
|
vlad
:
review+
|
Details | Diff | Splinter Review |
RgnRectMemoryAllocator wants to run only on a single thread, presumably so that it can avoid locking overhead. It does this by saving the thread on which it was created and asserting that its methods are only invoked on that thread.
The use of RgnRectMemoryAllocator in nsRegion presents a problem, however. nsRegion uses a static RgnRectMemoryAllocator, which is thus always initialized on the main thread. This means that embedders who want to use libxul on a thread that's not main have to deal with heaps of assertion failure errors, even though that code is only being used on that non-main thread. Electrolysis is one such embedder.
I don't know the best way to solve this issue. I'll go fishing with my first patch.
| Assignee | ||
Comment 1•16 years ago
|
||
I'm using this patch in Electrolysis by invoking it when our "Gecko" thread is initialized in the child process.
Attachment #388426 -
Flags: review?(vladimir)
| Assignee | ||
Comment 2•16 years ago
|
||
Corrected to bz's original idea.
Attachment #388426 -
Attachment is obsolete: true
Attachment #388433 -
Flags: review?(vladimir)
Attachment #388426 -
Flags: review?(vladimir)
Comment 3•16 years ago
|
||
So if that works... why not just make this heap-allocated (via new) from inside gfxPlatform::Init()?
| Assignee | ||
Comment 4•16 years ago
|
||
(In reply to comment #3)
> So if that works... why not just make this heap-allocated (via new) from inside
> gfxPlatform::Init()?
Two potential problems ... first, another statically-initialized variable is using RgnRectMemoryAllocator (potential tar baby in fixing that). Second, changing when this mini-heap is allocated might cause some obscure performance issue.
What gfx performance tests should I look at to see if this change is detrimental?
Comment 5•16 years ago
|
||
Huh. What's the other variable?
| Assignee | ||
Comment 6•16 years ago
|
||
Attachment #388433 -
Attachment is obsolete: true
Attachment #388552 -
Flags: review?(vladimir)
Attachment #388433 -
Flags: review?(vladimir)
Attachment #388552 -
Flags: review?(vladimir) → review+
| Assignee | ||
Comment 7•16 years ago
|
||
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•