[plt-scheme] Subprocess

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Jul 15 15:22:46 EDT 2002

At 15 Jul 2002 20:23:18 +0100, Paulo J. Matos wrote:
> The situation is as follows:
> I need to read from 'stdin' (user input) and check for any
> incoming information from a socket. I though about forking and
> then each of the processes would do a given operation. But
> afterwards I though that if there is a way to receive something
> from a socket and read user input at the same time without
> blocking, it would be great. (it remembers me Unix C Select)
> Any ideas on this?

Sounds like you just want to use `thread':

 (thread (lambda () ... do something in the background ...))

Even if a thread is blocked reading from a port (socket, stdin., or
whatever), other threads continue to run.


Posted on the users mailing list.