-
Notifications
You must be signed in to change notification settings - Fork 23
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
cog-set-atomspace! not switching the atomspace used by the cogserver #1
Comments
wait, where's the bug? It sets the space to alt-as correct it looks like? |
oh, nevermind, cog-set-atomspace supposed to return the previous atomspace |
is this still a bug? |
Yes. I also noticed the default atomspace and the new atomspace has different length, not sure if that's part of the problem.
|
This bug only happens in the lower scm shell, at port 17001 not the one at 18001 |
Yeah, I can reproduce this. It is a "feature" not a "bug". By design, each thread can have a different current atomspace. This so that you can run two threads, each doing different work in different atomspaces. It works, and I believe one of the unit tests tests this. The port-17001 shell processor works like this: it creates a new thread, evaluates the scheme in the new thread, and then ends that thread, returning any string output in the main command-prompt thread. You can verify this by issuing this on a single line: To avoid this confusion, we can change port 17001 to not fork a new thread for each command. This makes it sightly less convenient, though -- one then cannot send interrupts (ctrl-C) to kill the running process, if it hangs. Working with long-running scripts becomes hard too ... |
I'm strongly tempted to close this as "not a bug"; before closing, though, the docs for 17001 should be updated to explain this. |
ok, then basically the issue is how to handle multiple (nested or cloned) atomspaces in a single thread. I guess if one want to use multiple atomspaces, then they can swith to port 18001 |
By the way, what is the purpose of having two scheme shells? |
!? multiple nested/cloned atomspace work just fine in a single thread or in multiple threads. If you want to use port 17001 in a single thread, then you have three choices:
|
There are not two, but three scheme shells :-) all sharing the same atomspaces. so, for example:
The above shares the same atomspaces with both 17001 and 18001. The 17001 was the earliest implementation. The 18001 came later, when the guile guys added a simple tcpip server at some point. For me, 18001 has always been buggy, though, prone to hangs and weird behavior. Shame about that. The third form, of just running the cogserver inside scheme, instead of the other way around, only became possible recently, when we hacked together all the infrastructure needed for guile modules. |
That is clear, thanks. For interactive experimentation, 18001 or the third shell are enough. I have changed the labeling to documentation. This should come in handy for the python shell(or future haskell shell maybe) too. As consistant behavior, were possible, will make opencog-noob's life easier. |
Use SingularityNET docker images for CI
not sure if it is a cogserver bug or a guile binding bug
The text was updated successfully, but these errors were encountered: