Changes between Version 1 and Version 2 of ThreadCommunication


Ignore:
Timestamp:
Apr 12, 2011, 3:55:13 PM (14 years ago)
Author:
levin@chromium.org
Comment:

More details.

Legend:

Unmodified
Added
Removed
Modified
  • ThreadCommunication

    v1 v2  
    552. Common operations are need to be hand written each time requiring careful review of tricky lifetime code which is easy to get wrong.
    66
    7 To fix these, it would be good to have some common data structures which handle common operations without requiring much boilerplate code. Let's start by enumerating out common cases.
     7To fix these, it would be good to have some common data structures/api which handle common operations without requiring much boilerplate code. Let's start by enumerating out common cases.
    88
    99'''Use cases'''
     
    1717This does look suspiciously like a nested message loop with a filter which many people regard as evil. The only reason to allow this capability is for synchronous calls from javascript to call to the main thread to get some work done and act like a synchronous call but there may be callbacks (e.g. when doing a sync xhr call.) Theoretically, the javascript engine could roll up its state into a closure and we could avoid the nested message loop but that capability doesn't exist in the engines that we deal with and would be very expensive to add to them.
    1818
    19 3. Allowing for a thread pool scenario. (This isn't about implementing the thread pool but ensuring that the implementation suggested doesn't preclude one being done in the future).
     19Constraints:
     20The api should be simple to use and handle things like ensuring objects are appropriately copied or ref counted and make it easier to deal with lifetime issues.
     21
     22Either object should be able to be deleted at any time and the other side shouldn't cause any memory corruption issues by sending more messages.
     23
     24Allow for a thread pool scenario. (This isn't about implementing the thread pool but ensuring that the implementation suggested doesn't preclude one being done in the future).
    2025
    2126TBD: There are likely more use cases to be listed here.