A performant implementation of thread-safe string interning will be necessary for a multi-threaded VM. This is a tracking bug for any schemes we come up with. The initial patch is very simple: interning operations are just protected by a lock. However, as the interning operation can trigger a ZCT reap, unfortunately this lock has to be one of the safepointing-aware variety from bug 575544.
Created attachment 461042 [details] [diff] [review] Initial patch This patch is polluted by other bits of thread-safety work in AvmCore. The only relevant bits are those dealing with STRING_INTERN_LOCKER
Created attachment 525935 [details] [diff] [review] Latest. TR rev 6090. Patch queue rev 276
Attachment #461042 - Attachment is obsolete: true
(In reply to comment #2) > Created attachment 525935 [details] [diff] [review] > Latest. TR rev 6090. Patch queue rev 276 Note the use of GCAutoCollectionDisable to prevent deadlocks when trying to allocate a String when holding the interning lock. Also note that rehashing is disabled when the intern table is inspected from AvmCore::isInternedUint. This is an optimization so that the interning lock does not need to be acquired.
You need to log in before you can comment on or make changes to this bug.