Closed Bug 449222 Opened 17 years ago Closed 16 years ago

MMgc spends too many TLS slot entries

Categories

(Tamarin Graveyard :: Garbage Collection (mmGC), defect, P3)

x86
Windows XP
defect

Tracking

(Not tracked)

VERIFIED WONTFIX
Future

People

(Reporter: daumling, Assigned: treilly)

Details

XP has 1088 Thread Local Storage (TLS) slots per process, and Mac OSX seems to have only 128 for pthread_key_create (search for PTHREAD_KEYS_MAX). TT has a class that reserves a slot when instantiated (in GCThreadLocal.h), which wastes TLS entries; this is a bad policy for a shared component. GCThreadLocal.h needs to be rewritten to use a single TLS slot that contains a pointer to a structure containing all of the thread local data. The routine can also be rewritten that, in single-threaded mode, the getter for this structure just returns a pointer to a static instance, which speeds up accesses considerably.
Correction: Mac OSX has PTHREAD_KEYS_MAX increased from 128 to 512.
Sent too early: The maximum of 512 is valid for OSX 10.5++.
triaging. send to qrb.
Flags: flashplayer-triage+
Flags: flashplayer-qrb?
tom, can you take a look?
Assignee: nobody → treilly
Status: NEW → ASSIGNED
Flags: flashplayer-qrb? → flashplayer-qrb+
Priority: -- → P3
Target Milestone: --- → flash10.x
Its a valid bug but we don't use this class much so the need to fix is low.
Is this only affecting TT (as written) or does it affect redux/central as well?
No this affects all versions of tamarin
Target Milestone: flash10.x → Future
Tamarin currently uses four thread local slots, and that's being reduced to three when the sampler has been fixed. Two of the remaining three uses are somewhat gratuitous; they could be hung off the EnterFrame. Generally, thread local slots don't work well because VMs can be moved from thread to thread on a system that has a pool of VMs that it schedules on a smaller number of threads.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → WONTFIX
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.