Bug 51857 - cross thread communication should be simpler to use correctly and less fragmented.
Summary: cross thread communication should be simpler to use correctly and less fragme...
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: David Levin
URL:
Keywords:
Depends on:
Blocks: 51818 58171
  Show dependency treegraph
 
Reported: 2011-01-03 17:49 PST by David Levin
Modified: 2013-04-08 14:16 PDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Levin 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.
Comment 1 David Levin 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.
Comment 2 Dongseong Hwang 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.
Comment 3 Dongseong Hwang 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
Comment 4 David Levin 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.