[Webkit-unassigned] [Bug 74535] [chromium] Add postCancellable[Delayed]Task to CCThread

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 15 18:18:44 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=74535





--- Comment #15 from Tien-Ren Chen <trchen at chromium.org>  2011-12-15 18:18:44 PST ---
(In reply to comment #13)
> James: next step? Are you saying you only will accept a CCTimer class? I'd like to get trchen unblocked...
> 
> As I pointed out, my concern with a Timer and TimerClient/TimerTarget formulation is:
> 1. We lose the convenience that CCTask* gives you of arbitrary method binding
> 2. We can't do cross-thread cancellation
> 
> #1 is valuable when you have a single class that has a few different things going on.
> 
> #2 would help me implement those redundant commit messages we send to the main thread. I could just cancel any pending commit task when I create one.

Currently my implementation doesn't solve #2 either, but I can make a thread-safe version if people need it.

What's really tricky about the thread-safe version is that there is one more state we need to consider when we cancel -- in same-thread situation a task is either done or undone, in cross-thread situation it could be doing in progress.

And there is also the problem that the state can change between calls. For example we can't write something like this: if (task.isPending()) {task.cancel(); doSomethingAssumeUndone();}

I agree with James that we can survey existing implementation to find out what is the best. But it seems that either of of them provides a solution to above problem...

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list