[webkit-dev] Proposal and WIP implementation for refactoring cross thread communication

Sam Weinig weinig at apple.com
Thu Aug 16 13:48:45 PDT 2012


Function is definitely useful in non-cross thread cases.  It is analogous to std::function, and its use cases are very similar.  Please don't rename it.

-Sam

On Aug 15, 2012, at 7:35 PM, Kwonjin Jeong <gram at company100.net> wrote:

> I also thought about what you said. But I'm not sure whether WTF::Function will be used for cross thread communication only.
> 
> So, I'd like to know whether WTF::Function won't be used for single threaded case.
> 
> On Tue, Aug 14, 2012 at 8:57 AM, KwangYul Seo <skyul at company100.net> wrote:
> Currently, there is no code using WTF::Function in single-threaded code. It seems WTF::Function is intended to be used for cross thread communication. One evidence is that FunctionImplBase is thread-safe ref-counted, which is not super efficient for single threaded use cases.
> 
> If we have no plan to use WTF::Function for single threaded code, why don't we rename WTF::Function to WTF::CrossThreadFunction and add more features such as cross thread copying there?
> 
> Regards,
> Kwang Yul Seo
> 
> On Mon, Aug 13, 2012 at 9:26 PM, Kwonjin Jeong <gram at company100.net> wrote:
> Hi, WebKit.
> 
> There are several implementations of threads, tasks and cross thread communication. e.g. FileThread, DatabaseThread and StorageThread perform blocking IO asynchronously and invoke callbacks using ScriptExecutionContext. Each of these implementation is pretty similar, but there is no code sharing at all.
> 
> So, my team at Company 100 is trying to refactor cross thread communication. We wrote an API proposal and modified some thread code to use our new API. 
> 
> As the first step, we added two new abstractions for cross thread communcation:
> 
> 1) TaskThread is our new abstraction for the task thread. FileThread, DatabaseThread and other task threads reuse the code by inheriting from TaskThread.
> 
> 2) We also added CrossThreadFunction. It's used to pass a task to the task thread and invoke callbacks. CrossThreadFunction is similar to WTF::Function but it has some additional features. e.g., cross-thread parameter copying and ref counting.
> 
> Please refer to the following bug for details:
> 
> https://bugs.webkit.org/show_bug.cgi?id=92365
> 
> We welcome feedbacks on our work.
> 
> Thanks.
> 
> -- 
> ====================
> Kwonjin Jeong
> Computer Scientist
> Company 100, Inc.
> Phone: +82-10-9528-2581
> ====================
> 
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo/webkit-dev
> 
> 
> 
> 
> 
> -- 
> ====================
> Kwonjin Jeong
> Computer Scientist
> Company 100, Inc.
> Phone: +82-10-9528-2581
> ====================
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo/webkit-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20120816/60d0ef70/attachment.html>


More information about the webkit-dev mailing list