-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Threads API in Standard Library #1333
base: main
Are you sure you want to change the base?
Conversation
known deficiencies:
possible style issues:
|
@garlic0x1 What do you think about having a separate ASDF subsystem for this? Not 100% sure, but maybe would be a good idea for threadless use cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a type-safe API.
@@ -38,7 +38,9 @@ | |||
:depends-on (#:coalton-compiler | |||
#:coalton/hashtable-shim | |||
#:trivial-garbage | |||
#:alexandria) | |||
#:alexandria | |||
#+(or sb-thread threads openmcl-native-threads) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these should use the ASDF feature gates (ASDF has special syntax for this and your conditionals below)
;; Threads ;; | ||
;;---------;; | ||
|
||
(cl:defmacro spawn (cl:&body body) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My sense is to not include this, but open for debate.
;; Atomics ;; | ||
;;---------;; | ||
|
||
(coalton-toplevel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the API below should have conditionals in it. Maybe atomic values shouldn't be included in the thread API for now.
I will make a lower-level LispThread type that Thread can be turned into for equality tests and have current-thread/all-threads return that. Should make it properly typesafe. |
I have added a wrapper over
bordeaux-threads
to the standard library, it is only loaded if this reader conditional is satisfied:#+(or sb-thread threads openmcl-native-threads)
, which tests for thread capabilities in SBCL, ECL, and CCL.This might not be in scope for the standard library but I think it will be useful.