"Peter Hertmuller" <phertmuller@...> writes:
> I have been trying to set up my own sbcl using the 0.9.9 sources. Using the
> default options, and sh make.sh everything seems to work. The problem appears
> when you try to start up Slime, and you get the error "Don't know how to
> require sb-bsd-sockets". Googleing for help was not useful at all. Looking at
After "sh make.sh" run "sh install.sh" as root to install the newly
built SBCL and the contribs. If INSTALL_ROOT is non-default you need
to set the appropriate SBCL_HOME (refer to the INSTALL file for details).
If this fails, please report the exact sequence of steps as in
$ sh make.sh
...omitted build log (but include the bit at the end that reports
a succesfull build...
$ sudo sh install.sh
and the contents of the *inferior-lisp* buffer after starting Slime.
Cheers,
-- Nikodemus Schemer: "Buddha is small, clean, and serious."
Lispnik: "Buddha is big, has hairy armpits, and laughs."

I have been trying to set up my own sbcl using the 0.9.9 sources. Using the
default options, and sh make.sh everything seems to work. The problem
appears when you try to start up Slime, and you get the error "Don't know
how to require sb-bsd-sockets". Googleing for help was not useful at all.
Looking at the SBCL installation folder, there is no any package with the
contrib libraries (sb-bsd-sockets, asdf, and so on). After looking carefull=
y
to the scripts that help to set up the new binaries (make.sh and install.sh=
),
and specially if you type the make-target-contrib.sh, all the contribs
packages fail. I don't know the reason. I'm using Debian 3.0.
Could you please tell me what's going on here? Do I have to set up these
packages by hand (if so, how)
Thanks in advance for your help

On Tuesday 14 February 2006 14:29, John Connors wrote:
> After taking a look in the sbcl sources for undocumented juicy bits,
> I ended up using sb-thread:foreground-release as this seems to
> integrate nicely with the sessions handling. I'm not sure about it's
> exact semantics, though.
>
> John C.
Not sure whether what you need to do should integrate with session=20
handling, but the low level mechanism session handling employs is=20
condition variables. Have a look at the reader/writer example in the=20
manual if you haven't done so, already.
Cheers, G=E1bor

Daniel Barlow wrote:
> On Tue, Feb 14, 2006 at 09:58:10AM +0000, John Connors wrote:
>
>>While looking for the 'right' way to get a SCBL thread to wait for a
>>specified condition as part of an attempt to update port from the CLOCC, I
>>came across this gem in the McCLIM sources.
>
>
> Really, there _is_ no 'right' way. Threads in SBCL (as with threads
> in OpenMCL and any other implementation using "native" threads) are
> scheduled by the operating system, and the operating system, as a
> rule, can't evaluate arbitrary bits of Lisp to decide if a thread is
> runnable or not. So it has to run it to find out if it wants to run
> or not, which is not what I or anyone would really consider an
> efficient use of resources.
>
> Most of the uses of process-wait in the wild are for implementing
> higher-level synchronisation constructs like
> mutexes/semaphores/queues, and most of the Lisps with OS-scheduled
> threads already have efficient implementations of these that play
> nicely with the kernel scheduler (or at least have the potential to,
> which a Lisp-based solution will never have[*]). It would make far
> more sense to encourage people to use the higher-level constructs
> than provide them with a hacky workaround to shore up shonky code.
> See e.g. http://www.cliki.net/BORDEAUX-MP for one possible "standard"
> interface that includes mutexes and posix-style condition variables
>
>
>>Now this will work, but my understanding is when calling sched_yeild, a
>>thread gets completely expired and put at the back of the scheduling queue.
>
>
> The semantics of sched_yield have changed (possibly even more than
> once) from one Linux version to the next, and I can't even remember
> what it's suppsoed to do these days. I rather suspect that in the
> grand scheme of things it doesn't matter too much, as this approach is
> never going to be particularly efficient whatever you do.
>
>
> -dan
>
After taking a look in the sbcl sources for undocumented juicy bits, I ended up
using sb-thread:foreground-release as this seems to integrate nicely with the
sessions handling. I'm not sure about it's exact semantics, though.
John C.

On Tue, Feb 14, 2006 at 09:58:10AM +0000, John Connors wrote:
> While looking for the 'right' way to get a SCBL thread to wait for a
> specified condition as part of an attempt to update port from the CLOCC, I
> came across this gem in the McCLIM sources.
Really, there _is_ no 'right' way. Threads in SBCL (as with threads
in OpenMCL and any other implementation using "native" threads) are
scheduled by the operating system, and the operating system, as a
rule, can't evaluate arbitrary bits of Lisp to decide if a thread is
runnable or not. So it has to run it to find out if it wants to run
or not, which is not what I or anyone would really consider an
efficient use of resources.
Most of the uses of process-wait in the wild are for implementing
higher-level synchronisation constructs like
mutexes/semaphores/queues, and most of the Lisps with OS-scheduled
threads already have efficient implementations of these that play
nicely with the kernel scheduler (or at least have the potential to,
which a Lisp-based solution will never have[*]). It would make far
more sense to encourage people to use the higher-level constructs
than provide them with a hacky workaround to shore up shonky code.
See e.g. http://www.cliki.net/BORDEAUX-MP for one possible "standard"
interface that includes mutexes and posix-style condition variables
> Now this will work, but my understanding is when calling sched_yeild, a
> thread gets completely expired and put at the back of the scheduling queue.
The semantics of sched_yield have changed (possibly even more than
once) from one Linux version to the next, and I can't even remember
what it's suppsoed to do these days. I rather suspect that in the
grand scheme of things it doesn't matter too much, as this approach is
never going to be particularly efficient whatever you do.
-dan

While looking for the 'right' way to get a SCBL thread to wait for a specified
condition as part of an attempt to update port from the CLOCC, I came across
this gem in the McCLIM sources.
(declaim (inline yield))
(defun yield ()
(declare (optimize speed (safety 0)))
(sb-alien:alien-funcall
(sb-alien:extern-alien "sched_yield" (function sb-alien:int)))
(values))
(defun process-wait (reason predicate)
(let ((old-state (process-whostate *current-process*)))
(unwind-protect
(progn
(setf old-state (process-whostate *current-process*)
(process-whostate *current-process*) reason)
(loop
(let ((it (funcall predicate)))
(when it (return it)))
;(sleep .01)
(yield)))
(setf (process-whostate *current-process*) old-state))))
Now this will work, but my understanding is when calling sched_yeild, a thread
gets completely expired and put at the back of the scheduling queue. What was/is
wrong with sleep?

Hello SBCL-ers,
Edi thinks we need a publicity campaign, so here it is:
****************************************************************
* Don't miss the boat! *
* Here's your chance to meet some of the best Lisp *
* hackers in the known universe! *
* Do what 56 other Lispers did last week! *
* Register NOW for the European Common Lisp Meeting 2006! *
* Only 65 euros! *
* http://weitz.de/eclm2006/ ! *
****************************************************************
Arthur Lemmens

Dan Starr <dvstarr@...> writes:
> I am thinking of getting a new Intel-based Macintosh, but will need
> a Common Lisp. SBCL looks like the most likely candidate, because
> afterall, SBCL already compiles into the Intel instruction-set.
>
> Would this work: (1) load an SBCL binary for i386 on the new Mac,
> (2) recompile with 0.9.7? Suspect this would take some tweaking of
> the configure files.
>
> Or would this work: (1) load SBCL 0.9.0 binary on my old Mac, (2)
> cross-compile 0.9.7 into the Intel instruction set, (3) save a
> binary distribution file?
If I understand you rightly, neither of these would work as of right
now, because no work has yet been done on the Operating System support
needed by SBCL. (Each OS/Architecture combination has its
idiosyncratic ways of laying out machine information in signal
contexts, of dealing with floating point exceptions, and one or two
other things; the source files in src/runtime -- linux-os.c and
ppc-linux-os.c, for instance -- should give you some clues.) Having
said that, if the bindings to OS support were needed, then your second
plan is roughly how to cross-compile; there are some more details at
the internals wiki, at <http://sbcl-internals.cliki.net/Build&gt; (though
some small details have probably changed since that page was last
updated).
> Thirdly, with your encouragement, I would consider trying it myself,
> though I anticipate volleys of e-mail of error messages, etc.,
> because I am not an accomplished Unix freak. I learn of it what I
> must learn when I need to.
Please do give it a try, if I haven't managed to frighten you off yet.
I'd guess that the OS support files you need will look a bit like a
mishmash between ppc-darwin-os.c and x86-linux-os.c, but I actually
know no details of Apple's support.
Cheers,
Christophe

I am thinking of getting a new Intel-based Macintosh, but will need a
Common Lisp. SBCL looks like the most likely candidate, because
afterall, SBCL already compiles into the Intel instruction-set.
Would this work: (1) load an SBCL binary for i386 on the new Mac, (2)
recompile with 0.9.7? Suspect this would take some tweaking of the
configure files.
Or would this work: (1) load SBCL 0.9.0 binary on my old Mac, (2)
cross-compile 0.9.7 into the Intel instruction set, (3) save a binary
distribution file?
Are there obvious snags?
Secondly, is some other guy verging on doing this?
Thirdly, with your encouragement, I would consider trying it myself,
though I anticipate volleys of e-mail of error messages, etc., because
I am not an accomplished Unix freak. I learn of it what I must learn
when I need to.
please advise
-- devious dan

Hello all,
I have trouble compiling tinaa, a documentation generator for Common
Lisp, with SBCL 0.9.9.
I get an error message like the following on an (asdf-install:install
"tinaa")
debugger invoked on a SB-INT:BUG:
full call to SB-KERNEL:DATA-VECTOR-REF
This is probably a bug in SBCL itself. (Alternatively, SBCL might have been
corrupted by bad user code, e.g. by an undefined Lisp operation like
(FMAKUNBOUND 'COMPILE), or by stray pointers from alien code or from unsafe
Lisp code; or there might be a bug in the OS or hardware that SBCL is running
on.) If it seems to be a bug in SBCL itself, the maintainers would like to
know about it. Bug reports are welcome on the SBCL mailing lists, which you
can find at <http://sbcl.sourceforge.net/&gt;.
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [RETRY ] Retry performing #<COMPILE-OP NIL {C119091}> on
#<ASDF:CL-SOURCE-FILE "utilities" {B85F5F1}>.
1: [ACCEPT] Continue, treating #<COMPILE-OP NIL {C119091}> on
#<ASDF:CL-SOURCE-FILE "utilities" {B85F5F1}> as having been
successful.
2: [RETRY ] Retry installation
3: [ABORT ] Exit debugger, returning to top level.
(SB-INT:BUG "full call to ~S")
0]
As the message says it might be a bug in SBCL I thought posting might be
useful.
Thanks for any help,
Florian

On 9. Feb 2006, at 20:53, Peter Hertmuller wrote:
> Thanks Glenn for you help.
> I've been trying with the Trivial-sockets, as suggested by John in a
> previous message, and now both applications are able to
> communicate. I've
> created some code for the server site and for the client too. But the
> problem that I face now is how to execute instructions from the
> client in
> the server.
Perhaps you can get by with what xml-rpc offers; if so, then check
out http://common-lisp.net/project/s-xml-rpc/
This includes both a client and server. Not all Lisp datatypes travel
over xml-rpc, but it might be enough for what you need.
Regards,
Rudi

per an email suggestion I tried the following but it failed:
(130:0) $ sbcl --core /usr/local/lib/sbcl/sbcl.core
This is SBCL 0.9.9, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/&gt;.
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
could not open file "/usr/local/lib/sbcl/sbcl.core"
open: No such file or directory
(131:1) $ ls -l /usr/local/lib/sbcl/sbcl.core
-rw-r--r-- 1 Jonathan None 22425600 Feb 9 21:10 /usr/local/lib/sbcl/sbcl.core
Oh well.
--jfc

I downloaded and ran install.sh on Windows XP + Cygwin.
when I run sbcl it complains that it can't find sbcl.core, which is in
the default location /usr/local/lib/sbcl. OK, so I tried
bash$ export SBCL_HOME=/usr/local/lib/sbcl
but sbcl still complains that it "can't find core file".
Since the instructions don't mention any windows specifics (e.g. paths
like "C:\windows\sucks") I assumed that the win32 port was suppose to
run under cygwin.
If anyone wants to help feel free to jump in and say something.
Regards,
--jfc

Peter Hertmuller <phertmuller <at> gmail.com> writes:
> I don't know how to change the String to an instruction understable by
> the server. This means, how the server could translate from the String
Peter,
You might want to look at cl-store: http://common-lisp.net/project/cl-store/.
It is a library for serializing Common Lisp objects, storing them somewhere and
restoring them. The examples in the manual use a file as the destination place,
but a stream works just fine.
The thing I was building was a remote-eval server. You manually start up the
remote-eval server on the server with something like:
(start-remote-eval-server :port *default-remote-eval-server-port*)
This starts a socket server listening for remote-eval requests.
Then the client calls the remote-eval server with something like:
(remote-eval '(car ((a b c) d e f)) "server-host-name"
*default-remote-eval-server-port*)
remote-eval opens a stream to the server, serializes the form using cl-store,
and writes it to the stream and reads (in a blocking way) the result from the
stream.
The server gets the form, spawns off a worker thread & socket, reads from the
socket de-serializes the form, evaluates it with EVAL, serializes the result,
writes it back to the stream and then ends.
remote-eval then gets the serialized result from the read, de-serializes it and
returns it as the result of remote-eval, in this example
(A B C)
Some care was taken to allow the remote form to return multiple values and to
signal an error, in which case the condition is serialized and sent back as the
result, which is then either returned directly or re-signalled in the client
(depending on a parameter to the remote-eval call).
The advantage to something this is that it is a completely flexible mechanism
for doing what you outlined and can be reused in lots of different contexts.
You can develop your application protocol with functions or methods, then use a
remote evaluation strategy similar to what I outlined to just execute your
functions. You can then use the same remote-eval mechanism for anything else.
Because cl-store handles the serialization / de-serialization for you
automatically, your stream reads & writes involve serialized Common Lisp
objects, instead of string representations.
cl-store is pretty remarkable. About the only things that it can't serialize
are implementation dependent representations of things like closures,
functions, threads, open streams, what not. It handles all "normal" Common Lisp
data just fine.
I can't publish the code, because it's work I've done for my employer, but if
you want to discuss questions and how I solved them, feel free to ask here, or
privately in email. I'd be willing to share code snippets.
Glenn

Thanks Glenn for you help.
I've been trying with the Trivial-sockets, as suggested by John in a
previous message, and now both applications are able to communicate. I've
created some code for the server site and for the client too. But the
problem that I face now is how to execute instructions from the client in
the server. Maybe an example could ilustrate the scenario.
App 1 (Client)
App2 (Server)
The App2 stores information, and it is responsible to manage queries over
this info. To do that, it offers a complite set of functions to search and
retrive this information. For example, you can ask (in the standalone
version) something like:
(get-elements Condition1 &rest Cond2 CondN)
And this applications (that acts as a server) answer with a list of the
elements that follow those conditions (Cond1 ... CondN).
Now, I have a new application, that is the App1 (Client), and this needs th=
e
information provided by the App2. So, I can send instructions using the TCP
channel streams, but I don't know how the server has to understand the
orders. Suppose that we have already set up the stream channel, and this is
name "stream-channel". The client, send the instruction, like:
(format stream-channel "instruction-code")
I don't know how to change the String to an instruction understable by the
server. This means, how the server could translate from the String
"(get-elements Cond1 --- )" into a call of one of its functions.
Thanks anyway for your time
Peter
On 2/9/06, Glenn Ehrlich <glenn.ehrlich@...> wrote:
>
> Peter Hertmuller <phertmuller <at> gmail.com> writes:
>
> Peter,
>
> Forgot to add this link. This is a short thread discussing the
> implementation
> of the message broker I sent in a previous reply. It briefly discusses
> some
> issues coding with sockets with this example.
>
> http://thread.gmane.org/gmane.lisp.steel-bank.devel/5551
>
> Glenn
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486&dat=
=3D121642
> _______________________________________________
> Sbcl-help mailing list
> Sbcl-help@...
> https://lists.sourceforge.net/lists/listinfo/sbcl-help
>

Peter Hertmuller <phertmuller <at> gmail.com> writes:
>
> Hi all
> I'm trying to build up an application using SBCL 0.9.4 under linux 3.0.
...
> Has anybody an example and a little bit more detailed information about
> Sockets and Threads in SBCL? Is it necessary to use any other package
> apart from the sb-bsd-socket?
Peter,
I found the SBCL implementation of a message broker here to be very valuable in
helping me figure out the right combinations of calls to use with sb-bsd-socket.
It uses sockets (obviously!) as well as threads.
http://www.spe.com/pjm/message-broker.html
Hope this helps.
Glenn

Peter Hertmuller <phertmuller <at> gmail.com> writes:
Peter,
Forgot to add this link. This is a short thread discussing the implementation
of the message broker I sent in a previous reply. It briefly discusses some
issues coding with sockets with this example.
http://thread.gmane.org/gmane.lisp.steel-bank.devel/5551
Glenn

Peter Hertmuller wrote:
> Hi all
>
> I'm trying to build up an application using SBCL 0.9.4 under linux 3.0.
> This app will interact with other sbcl app to exchange information and
> to execute some functionalities.
> I've been googleing to find out information about sockets, threads and a
> short example to ilustrate their use. The info included in the manual
> was not enough. I was trying to use the short tutorial placed in the
> CL-cookbook, but this needs the package "port" and it was not possible
> to get this package correctly compiled using my SBCL version (and even
> the entery Clocc).
>
> Has anybody an example and a little bit more detailed information about
> Sockets and Threads in SBCL? Is it necessary to use any other package
> apart from the sb-bsd-socket?
>
> Thanks in advance for any help you can provide me.
>
>
> Peter
I had the same problem. I used cl-trivial-sockets, instead which may or may not
meet your needs. Port in CLOCC really needs updating for SBCL & ASDF, which is a
job I may just have volunteered for on the Gardeners list..the other advice I
recieved was to look at other packages with compatibility layers such as
ACL-COMPAT and SWANK.
John Connors.

Hi all
I'm trying to build up an application using SBCL 0.9.4 under linux 3.0. Thi=
s
app will interact with other sbcl app to exchange information and to execut=
e
some functionalities.
I've been googleing to find out information about sockets, threads and a
short example to ilustrate their use. The info included in the manual was
not enough. I was trying to use the short tutorial placed in the
CL-cookbook, but this needs the package "port" and it was not possible to
get this package correctly compiled using my SBCL version (and even the
entery Clocc).
Has anybody an example and a little bit more detailed information about
Sockets and Threads in SBCL? Is it necessary to use any other package apart
from the sb-bsd-socket?
Thanks in advance for any help you can provide me.
Peter

Hi all
I'm trying to build up an application using SBCL 0.9.4 under linux 3.0. Thi=
s
app will interact with other sbcl app to exchange information and to execut=
e
some functionalities.
I've been googleing to find out information about sockets, threads and a
short example to ilustrate their use. The info included in the manual was
not enough. I was trying to use the short tutorial placed in the
CL-cookbook, but this needs the package "port" and it was not possible to
get this package correctly compiled using my SBCL version (and even the
entery Clocc).
Has anybody an example and a little bit more detailed information about
Sockets and Threads in SBCL? Is it necessary to use any other package apart
from the sb-bsd-socket?
Thanks in advance for any help you can provide me.
Peter