-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add support for ABCL and Clasp #2
Conversation
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 really appreciate your support for adapting to implementation other than sbcl.
Thank you!
micros.asd
Outdated
@@ -1,41 +1,48 @@ | |||
(defsystem "micros" | |||
:depends-on () | |||
:depends-on (:bordeaux-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.
Adding a dependency in micros may risk a conflict between the library used by the user and the library used by micros, causing a malfunction.
Is there any way to avoid this?
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.
Ummm, I don't know really, if we want to make this compiled alone (without the Lem system), I think it's necessary
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.
For example, if users are developing bordeaux-threads, changing their implementation will likely cause micros to stop working.
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.
oooh, I see ummm, then maybe use some specific functions depending on the implementation, a little more manual, but that can be a solution
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.
Ok, so.... SBCL implement a couple of more things for hash-tables to work concurrently so I'm experimenting with https://github.com/no-defun-allowed/concurrent-hash-tables .
It doesn't solve the problem, given that we still have to use external dependencies, so I think if this version works for more implementation, the solution might be to fork it and integrate it in micro as a internal system.
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.
It's a pain if there is a but, because we would have to go to the main repo to check it, buut I'll add the default option for default SBCL to work with the native calls, so at least it works as intended in the reference implementation.
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.
The concurrent-hash-table is very interesting, thanks for sharing.
In this case, we need a mutex of hash-table in eval-for-emacs, but I don't think it requires much performance.
What about going with a simple with-lock-held pattern?
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.
Still, I would have to use the bt library for that (if I want it to be portable)
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.
micros(swank) has definterface and defimplementation.
Since we already have the bare minimum for threads, why not just use them?
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.
So, seems like swank already have some thread-locks implementations 🤦 , the code seems fine but it doesn't seem to work for SBCL.
swank.lisp
Outdated
;; Needless to say, this also excludes some internal bits, but | ||
;; getting there is too much detail when "unspecified" says what | ||
;; is important -- unpredictable, but harmless. | ||
`(bt:with-recursive-lock-held((hash-table-lock ,hash-table)) |
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.
Is it ok if don't add sb-int for hash-table-count?
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.
Sorry, what do you mean?
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.
Ah, it was hash-table-lock, not hash-table-count.
In other words, I think the function is unbound.
(fboundp 'hash-table-lock) => NIL
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.
Ups! Sorry, I was looking at the implementation and seems very sbcl specific
(https://www.sbcl.org/manual/#Hash-Table-Extensions)
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 really know how to solve it easily
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.
As a workaround, what about using mutex for except sbcl?
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'll take a look and see if it works, thanks 👍
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.
Related to the top comment
Thank you so much 🙏 |
Adapt the SLIME backed for Micros, it has been superficially testes tho, so there is probably need for some more testing.