[plt-scheme] Subprocess

From: Paulo J. Matos (pocm at mega.ist.utl.pt)
Date: Mon Jul 15 15:23:18 EDT 2002

> 
> At Mon, 15 Jul 2002 11:00:04 -0400, "Paul Steckler" wrote:
> > > In the MzScheme Manual I'm able find a subprocess function that
> > > given a path it'll run an executable as a subprocess, but is
> > > there a way to fork? (creating a children process)
> > 
> > I don't believe there is a way to fork a child process, other than
> > writing an extension that calls C's fork() directly.
> 
> That's correct.

Ok!

> 
> > But I'll bet that calling fork() messes up the invariants assumed by the
> > MzScheme run-time.
> 
> No, I don't think so. `subprocess' does a lot of work after an internal
> fork() to give a new program the right environment, but a forked
> MzScheme should be happy with MzScheme's environment.
> 
> It's possible that some of the socket code assumes unique ownership of
> the socket. But from a quick look, I think multiple MzSchemes for a
> socket shouldn't be a problem.
> 

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?

Best regards,

Paulo

> Matthew
> 
> 
> 

-- 
Paulo J. Matos : pocm(_at_)mega.ist.utl.pt
Instituto Superior Tecnico - Lisbon    
Software & Computer Engineering - A.I.
 - > http://mega.ist.utl.pt/~pocm 
 ---	
	Yes, God had a deadline...
		So, He wrote it all in Lisp!




Posted on the users mailing list.