| 1 | |
| 2 | 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. |
| 3 | |
| 4 | 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). |
| 5 | |
| 6 | 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. |
| 7 | |
| 8 | Here's my first pass at breaking things up: |
| 9 | |
| 10 | = Global Interp (one per Parrot) = |
| 11 | === Lock every time === |
| 12 | * mem_pools |
| 13 | * gc_sys |
| 14 | * gc_registry |
| 15 | * pdb |
| 16 | * iglobals |
| 17 | * hll_info |
| 18 | * hll_namespace |
| 19 | * root_namespace |
| 20 | * caches |
| 21 | * scheduler (global) |
| 22 | |
| 23 | === Assume RO, sync to write === |
| 24 | * class_hash |
| 25 | * vtables |
| 26 | * n_vtable_max |
| 27 | * n_vtable_alloced |
| 28 | * piodata |
| 29 | * op_lib |
| 30 | * op_count |
| 31 | * op_info_table |
| 32 | * op_func_table |
| 33 | * n_libs |
| 34 | * all_op_libs |
| 35 | * debug_flags |
| 36 | * run_core |
| 37 | * cores |
| 38 | * num_cores |
| 39 | * initial_pf |
| 40 | * imc_info |
| 41 | * output_file |
| 42 | * hash_seed |
| 43 | * op_mmd_cache |
| 44 | * const_cstring_table |
| 45 | * const_cstring_hash |
| 46 | * recursion_limit |
| 47 | |
| 48 | === dunno === |
| 49 | * lo_var_ptr |
| 50 | * world_inited |
| 51 | * exit_handler_list |
| 52 | * sleeping |
| 53 | * thread_data |
| 54 | |
| 55 | === Apparently not used === |
| 56 | * task_queue |
| 57 | * evc_func_table |
| 58 | * save_func_table |
| 59 | * parent_interpreter |
| 60 | |
| 61 | = Local Interp (One per actually-simultaneous task) = |
| 62 | * pc (implicit) |
| 63 | * ctx* |
| 64 | * flags |
| 65 | * code |
| 66 | * dynamic_env* |
| 67 | * scheduler (local) |
| 68 | * last_alarm |
| 69 | * quantum_done |
| 70 | * current_task |
| 71 | * current_cont |
| 72 | |
| 73 | * current_runloop |
| 74 | * runloop_jmp_free_list |
| 75 | * current_runloop_level |
| 76 | * current_runloop_id |
| 77 | |
| 78 | * Environments will require some more thought, since one task can close over data from another. |
| 79 | |
| 80 | = Global Scheduler (one per Parrot) = |
| 81 | * future alarms |
| 82 | * all tasks |
| 83 | |
| 84 | = Local Scheduler (one per interpreter) = |
| 85 | * task queue |
| 86 | * next_task_id |