Re: [Chicken-users] Pipe and thread problem

2012-10-25 Thread Felix
From: Moritz Heidkamp mor...@twoticketsplease.de Subject: Re: [Chicken-users] Pipe and thread problem Date: Wed, 24 Oct 2012 23:10:20 +0200 Hey Chickeneers, out of curiosity I implemented (probably horribly inefficitent) thread-aware replacements for open-input-file* and open-output-file

Re: [Chicken-users] Pipe and thread problem

2012-10-24 Thread Felix
From: Alan Post alanp...@sunflowerriver.org Subject: Re: [Chicken-users] Pipe and thread problem Date: Tue, 23 Oct 2012 16:14:17 -0600 Anyone with a better understanding of Chicken's internals able to comment on which cases poll() is called and how the timeout value is selected? poll(2

Re: [Chicken-users] Pipe and thread problem

2012-10-24 Thread Peter Bex
On Wed, Oct 24, 2012 at 03:21:15AM -0400, Felix wrote: Anyone with a better understanding of Chicken's internals able to comment on which cases poll() is called and how the timeout value is selected? poll(2) is not used in the runtime system. I think some libcs might implement select()

Re: [Chicken-users] Pipe and thread problem

2012-10-24 Thread Alan Post
On Wed, Oct 24, 2012 at 09:32:35AM +0200, Peter Bex wrote: On Wed, Oct 24, 2012 at 03:21:15AM -0400, Felix wrote: Anyone with a better understanding of Chicken's internals able to comment on which cases poll() is called and how the timeout value is selected? poll(2) is not used in

Re: [Chicken-users] Pipe and thread problem

2012-10-24 Thread Felix
From: Aaron Patterson tenderl...@ruby-lang.org Subject: [Chicken-users] Pipe and thread problem Date: Tue, 23 Oct 2012 14:30:57 -0700 Hi, I'm trying to simulate reading from a TTY that writes every two seconds. I want to do this with a pipe and two threads, one thread writes every N seconds

Re: [Chicken-users] Pipe and thread problem

2012-10-24 Thread Mario Domenech Goulart
Hi Felix, On Wed, 24 Oct 2012 08:04:37 -0400 (EDT) Felix fe...@call-with-current-continuation.org wrote: From: Aaron Patterson tenderl...@ruby-lang.org Subject: [Chicken-users] Pipe and thread problem Date: Tue, 23 Oct 2012 14:30:57 -0700 Hi, I'm trying to simulate reading from a TTY

Re: [Chicken-users] Pipe and thread problem

2012-10-24 Thread Felix
From: Mario Domenech Goulart mario.goul...@gmail.com Subject: Re: [Chicken-users] Pipe and thread problem Date: Wed, 24 Oct 2012 09:44:37 -0400 Hi Felix, On Wed, 24 Oct 2012 08:04:37 -0400 (EDT) Felix fe...@call-with-current-continuation.org wrote: From: Aaron Patterson tenderl...@ruby

Re: [Chicken-users] Pipe and thread problem

2012-10-24 Thread Jörg F . Wittenberger
Without having seen the code in question: my guess would be that those FILE*-ports would do i/o-buffering. flush-output might already help. ??? On Oct 24 2012, Felix wrote: From: Mario Domenech Goulart mario.goul...@gmail.com Subject: Re: [Chicken-users] Pipe and thread problem Date: Wed, 24

Re: [Chicken-users] Pipe and thread problem

2012-10-24 Thread Aaron Patterson
On Wed, Oct 24, 2012 at 08:04:37AM -0400, Felix wrote: From: Aaron Patterson tenderl...@ruby-lang.org Subject: [Chicken-users] Pipe and thread problem Date: Tue, 23 Oct 2012 14:30:57 -0700 Hi, I'm trying to simulate reading from a TTY that writes every two seconds. I want to do

Re: [Chicken-users] Pipe and thread problem

2012-10-24 Thread Moritz Heidkamp
with open-output-file* -- this is only because there is no flush-file in posix. Perhaps worth adding? Moritz Aaron Patterson tenderl...@ruby-lang.org writes: On Wed, Oct 24, 2012 at 08:04:37AM -0400, Felix wrote: From: Aaron Patterson tenderl...@ruby-lang.org Subject: [Chicken-users] Pipe

[Chicken-users] Pipe and thread problem

2012-10-23 Thread Aaron Patterson
Hi, I'm trying to simulate reading from a TTY that writes every two seconds. I want to do this with a pipe and two threads, one thread writes every N seconds, while the other reads any data available on the pipe. Unfortunately, my code just hangs. After speaking with the fine people in

Re: [Chicken-users] Pipe and thread problem

2012-10-23 Thread Alan Post
For me, that program is blocking on a call to poll(), which must be something that is happening in chicken's threading code. It is polling on two file descriptors with an infinite timeout, and clearly never coming back up for air. the produce thread is hanging on the thread-sleep call, and the