chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] writing from a thread issue


From: minh thu
Subject: [Chicken-users] writing from a thread issue
Date: Fri, 12 Jan 2007 12:39:26 +0100

Hi,

I made a script of my session to exhibit the problem:
No output is given by the thread but the blank lines.

Thanks for any help,
thu

Follows the output of my session (in a console in linux).

$ cat weird.scm
;;; weird.scm
;;
;; 12.01.2007
;;
;; Exhibits non-writing from a thread.
;;

(declare (uses srfi-18))

(define (poll-for-event)
 (define (poll) ((write "in poll-for-event") ; not shown
                  (newline)      ; shown
                  (flush-output) ; changes nothing
                  (thread-sleep! 1)
                  (poll)))
 (poll))

(define (go)
 (thread-start! poll-for-event))
$ csc -s weird.scm
$ csi -require-extension weird
)   ___
(__/_____) /)   ,    /)
 /       (/      _ (/_   _ __
/        / )__(_(__/(___(/_/ (_
(______)
Version 2, Build 3 - linux-unix-gnu-x86 - [ dload ptables ]
(c)2000-2005 Felix L. Winkelmann
; loading ./weird.so ...
#;1> (go)
#<thread: thread0>
#;2>






$ # I've done a ctrl-c. Notice the blank lines after #;2>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]