Closed Bug 649895 Opened 13 years ago Closed 6 years ago

AsymmGC - Collection while the gc-owner thread waits

Categories

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

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX
Q3 12 - Dolores

People

(Reporter: siwilkin, Unassigned)

References

Details

Attachments

(1 file)

This patch has been factored out from bug 624023.

It is the first of two patches that provide special-case synchronization constructs for use by asymmGC mutators.

It is an invariant forced upon asymmGC that only the gc-owner thread may perform the FinishIncrementalMark collection phase. This phase is triggered during allocation when a mutator's minor allocation budget is spent and there is no more major allocation budget from which to refill it. If a non-owner mutator (VM-thread) triggers this collection phase then it must *wait* for the gc-owner thread to perform the collection. The gc-owner thread 'recognizes' that such a collection must be performed by either exhausting its own minor allocation budget or by inspection of GC::m_hasCollectionWaiter at GC entry and exit points. For the common-case, this arrangement is perfectly fine. The question remains, however, of what happens if a gc-owner thread is *blocked* by a non-owner mutator that subsequently requires the gc-owner thread to perform a collection. In this case the non-owner mutator will wait forever for the gc-owner thread. I.e. we have deadlock.

There are two distinct scenarios that lead to the deadlock described above:

1) If a non-owner mutator attempts an allocation whilst holding a lock that can block the gc-owner thread.

2) If a non-owner mutator attempts an allocation whilst the gc-owner thread is waiting on some notification from the non-owner mutator.

This patch deals with scenario (2) described above. 

The general idea is to provide a specific wait/notify mechanism for use in this scenario (replacing that of vmbase::WaitNotifyMonitor) that allows a gc-owner thread to act as a dedicated collector whilst waiting on some notification.

So far I have only needed to use this in one instance: to enable thread-pool shutdown. See bug 582772.
Assignee: nobody → fklockii
Blocks: asymmGC
Retargeting to Dolores.
Target Milestone: --- → Q3 12 - Dolores
Assignee: fklockii → nobody
Flags: flashplayer-qrb+
Tamarin is a dead project now. Mass WONTFIX.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Tamarin isn't maintained anymore. WONTFIX remaining bugs.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: