|Version 2 (modified by Chandon, 4 years ago)|
For the gsoc_threads branch, I plan to split the interpreter structure into two parts in order to allow for efficient parallel thread (Task) execution: one global_interpreter structure that is shared and protected by locks or other concurrent access rules and many local_interpreters that run simultaneously in separate OS threads.
For the global data, some things will need to be protected by a global lock, while other things will be read-only by default and require ever interpreter to sync up before they can be written (using the same syncing mechanism as for gc).
I'm not sure if there's actually a difference between schedulers and interpreters. With the event system gone, the scheduler PMC may simply be extraneous.
Here's my first pass at breaking things up:
Global Interp (one per Parrot)
Lock every time
- scheduler (global)
Assume RO, sync to write
Apparently not used
Local Interp (One per actually-simultaneous task)
- pc (implicit)
- scheduler (local)
* Environments will require some more thought, since one task can close over data from another.
Per OS Thread
This is used by the GC - apparently I'll have to go figure out stack walking so I can make it happen for every OS thread.
Global Scheduler (one per Parrot)
- future alarms
- all tasks
Local Scheduler (one per interpreter)
- task queue