Hello Marc
I've tried your code from
https://mercure.iro.umontreal.ca/pipermail/gambit-list/2009-June/003649.html
One problem I'm having with this is that hitting ctl-d (even once)
will close the xterm. Also, on the new xterm the repl history from the
previous instance is lost. Also, ctl-c doesn't work as it should (it
makes the xterm go away instead of interrupting the program).
You're starting a proxy process inside the xterm which then connects
back to Gambit using tcp and intermediates between the tty and the
debuggee. Now maybe you did this for portability to windows, but on
unix it should be possible to allocate a pseudo tty and just pass it's
fd to the terminal emulator. urxvt (rxvt-unicode) has a "-pty-fd
file_descriptor" option, and xterm has a "-Sccn" option which should
do the same thing (the xterm man page is a bit confusing about that
option and I haven't tried it yet).
So this would enable multithreaded debugging with only the master
Gambit process running (debuggee = debugger), which should make it
much simpler and more robust. But Gambit will have to accept multiple
console ports; i.e. I'll have to instantiate a repl with it's own fd
in the new threads, either as lexical closure or in a parameter
object. Can you tell me how to make this work?
What I don't know yet is how signals (ctl-c) will behave, I guess all
pty's will send the signals to Gambit, I don't know how to check which
pty was responsible for a signal so as to map it back to the thread(s)
which is(are) using that pty. I suppose there is some unix api for
that.
Thanks,
Christian.
Hi. I found on IRC an user willing to join the list.
Yet, the URL https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
is not really helping him join the list.
Could this be fixed?
(Or the procedure written on the wiki, such as "send an email to
gambit-list-request on this domain and with this topic", or whatever
else?)
Cheers,
P!
--
Français, English, 日本語, 한국어
I realixe, per section 13.2,
Each thread has a "mailbox" which is used for inter-thread
communication.
however, is there a builtin for global mailboxes (mailboxes taht are
just variables; rather than mailboxes associated with threads)?
Thanks
Hi!
I have some pre-existing library code I'm dealing with, which I can
pass it an port (that the library will send output to).
Is it possible to create a function foo, so that
(foo output-port1 output-port2)
will return me a output-port-magic
s.t. when anything iw written to output-port-magic, it's written to
both output-port1 and output-port2?
Thanks!
Hi,
I have found the following remark by Marc in one of the posts,
On some platforms (processor and operating system dependent) that can
execute dynamically generated machine code (32 bit intel, power-pc,
sparc), you can pass any procedure including closures. This feature
is enabled if USE_dynamic_code_gen is defined in lib/os_dyn.h and this
is the default in recent versions of Gambit. Give it a try... it may
work to pass a closure on your platform... but don't count on it to be
portable!
Could somebody explain how it works?
michele
Marc:
At this point, gcc 4.5.0 promises to be able to compile most
Gambit-generated C files at high optimization levels in a "reasonable"
amount of CPU time and memory. So I configured Gambit with
./configure CC='/pkgs/gcc-mainline/bin/gcc -march=core2 -msse4 -O3 -fschedule-insns' --enable-multiple-versions --enable-single-host"
and then I removed by hand the "-O1" compilation options inserted into
the makefiles by the configure script. The version of gcc I used was
heine:~/programs/gambc-v4_5_2-devel> /pkgs/gcc-mainline/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/pkgs/gcc-mainline/bin/gcc
COLLECT_LTO_WRAPPER=/pkgs/gcc-mainline/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../../mainline/configure --enable-checking=release --prefix=/pkgs/gcc-mainline --enable-languages=c --disable-multilib
Thread model: posix
gcc version 4.5.0 20091005 (experimental) [trunk revision 152459] (GCC)
With my quickie benchmark program:
gsi/gsi -e '(define a (time (expt 3 10000000)))(define b (time (* a a)))'
the routine (direct-fft-recursive-4 a table) computed the final direct
(forward) FFT with 2097152 complex elements in 156 ms. This means that
we were getting
> (/ (* 5 2097152 21) .156)
1411544615.3846154
FLOPS (because it takes $5 N \log_2 N$ floating-point operations for an
FFT of size N). So that's 1411 MFLOPS with a 2.33 GHz Core 2 Duo; FFTW
reports about 2200 MFLOPS on a 3.0 GHz Xeon Core Duo using the Intel
compiler icc here:
http://www.fftw.org/speed/CoreDuo-3.0GHz-icc64/
The Xeon has a faster memory bus and is generally faster than the Core 2
Duo clock-per-clock; but just the ratio of CPU speeds would give a rate
of
> (* 1411 (/ 3.0 2.33))
1816.7381974248929
predicted MFLOPS for Gambit.
I'm not going to get into a slanging match about gcc versus icc, but
overall this looks pretty damn good.
Brad
Hi,
I have the following two functions for converting a pointer to some
struct Foo into the "value" struct Foo:
(define value-Foo-1
(c-lambda ((pointer (struct "Foo"))) (struct "Foo")
#<<c-lambda-end
void* mem = malloc(sizeof(Foo));
new (mem) Foo(*___arg1);
___result_voidstar = mem;
c-lambda-end
))
(define value-Foo-2
(c-lambda ((pointer (struct "Foo"))) (struct "Foo")
"___result = *___arg1;"))
(value-Foo-1) works and (value-Foo-2) crashes. Is this expected?
If so, is there a more elegant way to express the code of value-Foo-1?
Also: is it OK to use malloc here or am I supposed to use ___alloc_rc
or ___C_ASSIGN_NEW ?
Do I have to worry about providing code for releasing the memory allocated?
Finally, I am curious whether there is any difference internally
between the handling of (struct "Foo") and (type "Foo"), or is this
just naming for the sake of clarity?
Hi Brad!
Where can I get my hands on a meroon system integrated with recent gambit
builds? I couldn't find it on your homepage and neither on the meroon official
webpage which seems to point to a bad url.
Thanks!
David
Marc:
I tried to upload
MeroonV3-2008Mar01.tar.bz2
and got the message
Upload warning
".bz2" is an unwanted file type
List of allowed file types: png, gif, jpg, jpeg, scm,
tgz, zip, pdf, odf, doc, html
That's a little old fashioned, isn't it?
Brad