chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] readline blocks threads


From: Elf
Subject: Re: [Chicken-users] readline blocks threads
Date: Tue, 4 Mar 2008 12:26:27 -0800 (PST)


(unless (eq? (build-platform) 'msvc)
  (set! ##sys#read-prompt-hook
    (let ([old ##sys#read-prompt-hook]
          [thread-yield! thread-yield!] )
      (lambda ()
        (when (or (##sys#fudge 12) (##sys#tty-port? ##sys#standard-input))
          (old)
          (##sys#thread-block-for-i/o! ##sys#current-thread 0 #t)
          (thread-yield!)))) ) )

in srfi-18 is how it handles the special case of the repl. i rather doubt it would work for readline.

-elf

On Tue, 4 Mar 2008, Jim Ursetto wrote:

Unit SRFI-18:

"Blocking I/O will block all threads, except for some socket operations (see the
section about the tcp unit). An exception is the read-eval-print loop on UNIX
platforms: waiting for input will not block other threads, provided the current
input port reads input from a console."

On 3/4/08, Shawn Rutledge <address@hidden> wrote:
On Tue, Mar 4, 2008 at 12:05 PM, Elf <address@hidden> wrote:
um... repl will always block threads. as the docs state, read is
blocking
except for certain network ports.

If you try the example threaded loop without readline, it works.


_______________________________________________
Chicken-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-users






reply via email to

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