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