Summary

File ports should be nonblocking

Metadata

Description

As shown by this ugly little program, reading from regular files blocks.

 (use srfi-18)
 
 (thread-start! (lambda () (let lp () (print "spinning") (thread-sleep! 0.2) (lp))))
 (thread-start! (lambda () (with-input-from-file "/dev/tty" (lambda () (let lp () (print (cons 'read-from-tty (read))) (lp))))))
 
 (thread-sleep! 1000)

Changes and comments

[2016-07-01 11:52:40 UTC] sjamaan changed description

[2016-08-25 20:45:26 UTC] sjamaan set difficulty to hard

[2023-11-06 23:43:46 UTC] felix changed milestone from someday to 6.0.0