[gambit-list] Question on "buffering:" option for vector-port

Meng Zhang wsxiaoys.lh at gmail.com
Sun Jan 22 12:09:27 EST 2012


I expect the reading option may block the thread with "buffering: #f".

For example:
(let ((chan (open-vector '(buffering: #f))))
 (thread-start!
 (make-thread
 (lambda ()
 (write "Value" chan)
 (pp "Write done"))))
 (thread-start!
 (make-thread
 (lambda ()
 (thread-sleep! 1)
 (pp "Start reading")
 (pp (read chan)))))
 (thread-sleep! 5))

My expectation:
Outputs:
"Start reading"
"Write done" or "Value", in any order.

Result for 4.6.3, osx 10.6.7:
Outputs:
"Write done"
"Start reading"
"Value"

Obviously, the "read" option doesn't block the spawned thread even "buffering" is set to #f.
Did I misunderstand it?

-- 
Meng Zhang
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20120123/1ad18e3d/attachment.htm>


More information about the Gambit-list mailing list