chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] All threads are blocking by I/O


From: Pedro Melendez
Subject: Re: [Chicken-users] All threads are blocking by I/O
Date: Wed, 25 Sep 2013 09:12:14 -0400

Hi Peter,

Thank you so much for the help! I just tried it on a linux box and I can confirm you that is a windows specific behaviour :(

> I tested it out (via csi -s mini-tcp-server.scm) and it kept looping and
> when I connected with telnet it started printing "Hola" to my telnet
> client.

> Is that the correct behaviour?

Yes it is, the thing is that "Hola" was a test and should happens no matter what because is in a separate thread, but unfortunately the behaviour on Windows is that it gets stopped by the read-line function.

> Perhaps you're running it from the REPL?  The standard input for csi is
> usually line-buffered, so it's the OS itself which might be blocking the
> process while reading from stdin for the next command to run.  This can
> be worked around on UNIX by installing the parley egg.  However, I don't
> know if this works on Windows, because of the above-mentioned FUBAR
> select() implementation.

I am not using the REPL because I noticed that it was blocking everything unless I did a thread-join, so I opted to compile and test all the time (like we do with our old friend C/C++ :)


It shouldn't be, but our Windows implementation uses Winsock select(),
> which is really Microsoft's own "special" interpretation of POSIX select()
> which doesn't work on anything except sockets.  However, this *should*
> still work since you're only using tcp ports.

This makes a lot of sense, so I guess my only option is too debug the C++ side of the tcp implementation on Windows? Or do you know a workaround I could try for this?

Thanks again for everything, All your comments had been very helpful 

Cheers,

Pedro


On Wed, Sep 25, 2013 at 8:42 AM, Peter Bex <address@hidden> wrote:
On Wed, Sep 25, 2013 at 05:21:57AM -0700, Pedro Melendez wrote:
> Hi Peter!
>
> Thank you so much for your response!
>
> I don't understand then what I am doing wrong, this is what I have so
> far:
>
> https://github.com/pmelendez/scheme-test-server/blob/master/mini-tcp-server.scm
>
> Please notice that the code is dirty because it is a work in progress
> and I am kinda stuck.

I tested it out (via csi -s mini-tcp-server.scm) and it kept looping and
when I connected with telnet it started printing "Hola" to my telnet
client.

Is that the correct behaviour?

The code itself looks fine to me, from a quick glance.

> One detail I forgot to mention is that I am testing this on windows.

That's a very important little detail :)  There are still some important
glitches left on Windows, unfortunately.

> Now after your explanation... Is it possible that the behavior is
> platform-specific?

It shouldn't be, but our Windows implementation uses Winsock select(),
which is really Microsoft's own "special" interpretation of POSIX select()
which doesn't work on anything except sockets.  However, this *should*
still work since you're only using tcp ports.

Perhaps you're running it from the REPL?  The standard input for csi is
usually line-buffered, so it's the OS itself which might be blocking the
process while reading from stdin for the next command to run.  This can
be worked around on UNIX by installing the parley egg.  However, I don't
know if this works on Windows, because of the above-mentioned FUBAR
select() implementation.

I hope this helps.

Cheers,
Peter
--
http://www.more-magic.net



--
T: +1 (416) - 357.5356
Skype ID: pmelendezu



reply via email to

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