Thread-safe string/namespace interning

NEW
Assigned to

Status

Tamarin
Virtual Machine
8 years ago
7 years ago

People

(Reporter: Simon Wilkinson, Assigned: Garnet Chaney)

Tracking

(Depends on: 1 bug, Blocks: 3 bugs)

unspecified
Dependency tree / graph
Bug Flags:
flashplayer-qrb +

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

8 years ago
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.
(Reporter)

Comment 1

8 years ago
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
(Reporter)

Updated

8 years ago
Depends on: 555760, 555765
(Reporter)

Updated

8 years ago
Blocks: 582817
(Reporter)

Updated

8 years ago
Blocks: 600723

Updated

8 years ago
Assignee: nobody → siwilkin
Flags: flashplayer-qrb+
(Reporter)

Updated

7 years ago
Assignee: siwilkin → gchaney
(Reporter)

Comment 2

7 years ago
Created attachment 525935 [details] [diff] [review]
Latest. TR rev 6090. Patch queue rev 276
Attachment #461042 - Attachment is obsolete: true
(Reporter)

Updated

7 years ago
Depends on: 649920
(Reporter)

Comment 3

7 years ago
(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.
(Reporter)

Updated

7 years ago
Blocks: 650108
You need to log in before you can comment on or make changes to this bug.