This is going to sound like a daft question, but: is there any reason
that the thread that calls 'touch' needs to be the same thread that
calls its continuation?

I.e. why does there need to be a special "main thread"?  Can't "picking
up a job blocking on touch" just be another task allocated to the
thread pool?

Rubbish diagram:

       Thread A                 Thread B
       --------                 --------
   Creates a future F             ...
         ...                 Starts computing F
     Touches F                    ...
Starts computing future G         ...
         ...                 Finishes computing F
         ...              Continues job that touched F


Is this not a plausible approach?

                           Peter

-- 
Peter Brett <pe...@peter-b.co.uk>
Remote Sensing Research Group
Surrey Space Centre


Reply via email to