Real multi-threading #2

Open
opened 4 years ago by MightyPork · 0 comments
Owner

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-threading 4 years ago
MightyPork added the
feature
ft-core
labels 4 years ago
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: MightyPork/crsn#2
Loading…
There is no content yet.