[Webkit-unassigned] [Bug 92365] Refactor cross thread communication

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 27 20:06:40 PDT 2012


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





--- Comment #14 from Kwonjin Jeong <gram at company100.net>  2012-07-27 20:06:42 PST ---
(In reply to comment #13)
> (In reply to comment #12)
> > (In reply to comment #11)
> > > (In reply to comment #4)
> > > > One more comment re TaskThread, instead of making it ThreadSafeRefCounted, I'd suggest make a TaskThreadProxy that other threads could use. (The Proxy would hold some sort of weak pointer to a TaskThread.) From what I've seen typically it is nice for a run loop to know which thread it will be destroyed on.
> > > 
> > > It's a good idea. But in this step, I just want to refactor current code. 
> > > I will consider further improvements in the next step.
> > 
> > I think it is important to proceed this refactoring efforts step by step. As Kwonjin mentioned in the design document, the first step is to extract common code into reusable components. Once we have WTF::CrossThreadFunction, TaskGroup and TaskThread in hand, we can easily add fancier features.
> > 
> > 
> > BTW, Levein, do you know actual WebKit code that can benefit from TaskThreadProxy?
> 
> I don't believe that the current implementations of TaskThread are ThreadSafeRefCounted so that would be a change and may introduce some issues when it may be deleted on any thread.

The sole reason why TaskThread inherits ThreadSafeRefCounted is to prevent TaskThread instance from being deleted while the thread is running.
TaskThread holds a RefPtr for itself all the while so TaskThread isn't deleted. You can find the similar implementations on FileThread and DatabaseThread.

-- 
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