[gambit-list] Threads IO question
Patrice Rault
parault2 at wanadoo.fr
Sat Jun 4 09:16:15 EDT 2005
Le samedi 04 juin 2005 à 04:29 -0300, leo lencioni a écrit :
> I'am a scheme newbie and trying to learm scheme. I have the following function:
>
> (define (disp-msg msg)
> (display msg)
> (newline))
>
> I'am using it inside inside a thread to print debug info.
>
> (thread-start! (make-thread (lambda () (disp-msg "Hello")))
>
> Running it inside GSI gives no problem and everithing goes well. But
> when I compile it they show no output. I'am compiling with gsc with
> no options. Linux/debian. Gambit 4.0 b13. What I'am doing wrong? I'am
> missing compiler options.
>
> Thanks for your help
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> http://mailman.iro.umontreal.ca/mailman/listinfo/gambit-list
>
>
>
Also i am a Scheme newbie but try the following code as mthread.scm for
example
(define (disp-msg msg)
(display msg)
(newline))
(define t (thread-start! (make-thread (lambda () (disp-msg "Hello")))))
(thread-join! t) ;; to get the prompt again
;; for compiled and interpreted code
> gsc mthread.scm
You got 2 C files "mthread.c" and "mthread_.c".
> gcc mthread.c mthread_.c -lgambc -o mthread
> ./mthread
> Hello
>
The better way is to read the Gambit-C documentation.
Regards.
pat
More information about the Gambit-list
mailing list