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
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
David Levin
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
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
> 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
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.