After lots of debates off-list (specially with BrowserUk), I got to the
following conclusions:

 - Each OS thread runs a cooperative-event-scheduler where coroutines
   might be enqueued.

 - map returns the buffer immediatly and enqueues a coroutine to process
   the data.

 - Explicit parallel markings such as the feed operator, means a new OS 
   thread with its own cooperative scheduler is spawned.

 - Data that is shared between thread is selectively marked that way to 
   make sure they are thread safe.

 - The actor model can be implemented in a different module.

So, a quick summary of how the following code would run is attached:

  my @a := map { cheap_op($_) } <== map { expensive_op($_) }, $*IN

The "value sharing framework" is still to be designed, but it's clear
that forcing actor model for everything was too intrusive, so we allow a
balance of "shared state" and "massage-passing" concurrency. This
balance will be implemented by modules.

comments are appreciated.


<<attachment: Perl6ThreadingModel.svg>>

Reply via email to