Add a module that implements real multi-threading.
A thread would be called like a routine, and work as a stand-alone process until calling (ret) from the top level. Spawning a thread would create a handle. The caller can then wait for the return values using (join @handle).
Everything is easy and straightforward, except how to deal with objects passing into the thread as arguments.
Just do nothing and disallow handle passing between threads. This will suck but may be good enough for an initial implementation.
Referenced objects can be moved into the thread's extension store. This requires some cooperation from extensions.
The whole extension store can be cloned. Maybe. This sounds like a bad way to do it.
Put extension data in an Arc Mutex and share it with threads. rip performance
Add a module that implements real multi-threading.
A thread would be called like a routine, and work as a stand-alone process until calling `(ret)` from the top level. Spawning a thread would create a handle. The caller can then wait for the return values using `(join @handle)`.
Everything is easy and straightforward, except how to deal with objects passing into the thread as arguments.
- Just do nothing and disallow handle passing between threads. This will suck but may be good enough for an initial implementation.
- Referenced objects can be moved into the thread's extension store. This requires some cooperation from extensions.
- The whole extension store can be cloned. Maybe. This sounds like a bad way to do it.
- Put extension data in an Arc Mutex and share it with threads. rip performance
MightyPork
changed title from Multi-threading to Real multi-threading4 years ago
Add a module that implements real multi-threading.
A thread would be called like a routine, and work as a stand-alone process until calling
(ret)
from the top level. Spawning a thread would create a handle. The caller can then wait for the return values using(join @handle)
.Everything is easy and straightforward, except how to deal with objects passing into the thread as arguments.
Multi-threadingto Real multi-threading 4 years ago