[Webkit-unassigned] [Bug 95057] [chromium] Allow impl-thread deletion of only some resources

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 5 22:50:15 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=95057





--- Comment #44 from James Robinson <jamesr at chromium.org>  2012-09-05 22:50:29 PST ---
(In reply to comment #36)
> (In reply to comment #34)
> > (In reply to comment #33)
> > > So there does exist a bug here -- a reduceMemory() call can destroy a backing that has been handed to the main thread, but the main thread hasn't deleted yet.  I don't see a way around that without basically going back to the scheme of having a list of evicted textures in the PTM which is protected by a mutex (so, going back to the old scheme).
> > 
> > Can this actually happen though? reduceMemory() can only occur during a commit when the main thread is blocked, and it appears as though there can not be any other list of evicted backings in flight from when the task is posted through to when the commit is finished. So it seem to me we just need to process that list during the commit and we should be fine.
> >
> > > The mutex-protected list of evicted textures would still be needed, though.
> > 
> > I might be wrong, but could mutex be avoided like this?
> > <snip>
> 
> I think that you are right, but it's not very clear.  I feel very confident about correctness and performance of the mutex scheme, and I'd prefer to check that in first.

Ah yes, I see Eric's suggested pretty much the exact same thing earlier on.  Serves me right for skimming the thread.

The message passing method is how we handle nearly all shared state in the compositor (and for that matter in most of chromium) and is IMO a lot easier to reason about.  The thing that makes the mutex based version really hard to reason about is you can know that can get an internally consistent picture from any thread, but it's really hard to reason about *which* picture you got.  Hence the awkward ack passing scheme in your patch.  If you instead embrace message passing then it gets easier to think about things in terms of what each thread has told the other thread about.  Once thread A passes the data into a message to thread B, thread A never has to worry about it any more - it's gone.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list