Bug 51857

Summary: cross thread communication should be simpler to use correctly and less fragmented.
Product: WebKit Reporter: David Levin <levin>
Component: WebCore Misc.Assignee: David Levin <levin>
Status: RESOLVED WONTFIX    
Severity: Normal CC: ap, dimich, dongseong.hwang, dslomov, gram, kinuko, levin, nduca, skyul
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 51818, 58171    

David Levin
Reported 2011-01-03 17:49:19 PST
Right now there are several implementations of task and places using ScriptExecution::Task that shouldn't be. Also every place that does cross thread communication needs to carefully manage lifetimes of objects on both threads. Ideally, there would be one simple mechanism that these multiple places could use, and it would automatically take care of lifetime issues (or at least make them simpler to handle than they are now). This is an placeholder bug for whatever happens to do this as there isn't any design yet.
Attachments
David Levin
Comment 1 2011-04-12 15:45:01 PDT
Started a wiki page https://trac.webkit.org/wiki/ThreadCommunication based on misc conversations. It is a work in progress but feel free to modify.
Dongseong Hwang
Comment 2 2012-05-03 03:31:53 PDT
Exactly! There are several duplicated implementations for thread and task. ScrollingThread StorageThread FileThread DatabaseThread WorkerRunLoop for WorkerThread WorkQueue etc.. I think we need to gather adhoc implementation into WTF. I think RunLoop is a promising candidate to replace all adhoc threads. 79460 is for it. Or, 76751 said that Chromium developers may move WebThread to WTF. Thread Communication is more difficult because we use c++. http://dev.chromium.org/developers/design-documents/threading Chromium has already studied a lot. I think most complexities are originated from cross-thread refCount because C++ does not have Garbage Collector. We has a similar implementation; WTF/Functional.h I think improving Functional is better than implementing something like Task, because Task will cause huge boilerplate code.
Dongseong Hwang
Comment 3 2012-05-03 03:32:51 PDT
> I think RunLoop is a promising candidate to replace all adhoc threads. > 79460 is for it. Bug 79460 > > Or, 76751 said that Chromium developers may move WebThread to WTF. Bug 76751
David Levin
Comment 4 2013-04-08 14:16:47 PDT
This seems good to do but I think people know that regardless of there being a bug or not and this bug hasn't seen activity in about a year.
Note You need to log in before you can comment on or make changes to this bug.