Closed
Bug 593231
Opened 14 years ago
Closed 14 years ago
Consider using a main thread refcount on strings
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
INVALID
People
(Reporter: justin.lebar+bug, Unassigned)
Details
Split off from bug 585661.
I'm going to play around with a simpler approach:
* Keep a main-thread refcnt and a global refcnt.
* In addref / release, check whether we're the main thread. If so, modify
only the main-thread refcnt using a regular, thread-unsafe operation. When the
main-thread refcnt goes from 1 to 0, atomically decrement the global refcnt
and, if the new global refcnt is 0, delete the object.
Reporter | ||
Comment 1•14 years ago
|
||
I see no reason offhand we couldn't do this for more than just strings, but maybe strings are a good place to start.
Reporter | ||
Comment 2•14 years ago
|
||
Hm...this might not work.
The assumption is that main-thread addrefs will be balanced by main-thread releases. This does not seem to be the case.
This assumes not merely balance, but also that the object is destroyed on the main thread.
Reporter | ||
Comment 4•14 years ago
|
||
(In reply to comment #3)
> This assumes not merely balance, but also that the object is destroyed on the
> main thread.
Why? You destroy the object once the global refcnt goes to 0, regardless of whether that was caused by the main thread releasing the object or another thread releasing the object.
Ah, you are right of course.
Reporter | ||
Comment 6•14 years ago
|
||
This bug is going nowhere, fast. Since main-thread addrefs aren't balanced by main-thread releases, I think the approach is INVALID.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
Assignee | ||
Updated•4 years ago
|
Component: String → XPCOM
You need to log in
before you can comment on or make changes to this bug.
Description
•