chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Any way to get the scsh-process egg working on Windo


From: Omar Antolín Camarena
Subject: Re: [Chicken-users] Any way to get the scsh-process egg working on Windows?
Date: Wed, 7 Aug 2013 12:18:41 -0400

Thanks, Peter! I agree that it wouldn't be worth adding code for
special cases that can be run without forking. I thought that maybe I
would right my own version of run for, say, a single pipe form, but I
think I'll take John Cowan's advice and just build Chicken on cygwin.

As for getting fork-like functionality on Windows, one way of course
is to use cygwin's implementation of fork on top of the Windows API,
using CreateProcess(). I don't know the details at all, but I remember
reading that it's a bit of work, since cygwin has to copy the state of
the current process to the new one (making it slower than fork() on
Unix which uses copy-on-write). So I think it is perfectly reasonable
to declare that Chicken users on Windows that want process-fork must
use cygwin.

On Wed, Aug 7, 2013 at 10:22 AM, Peter Bex <address@hidden> wrote:
> On Wed, Aug 07, 2013 at 09:34:18AM -0400, Omar Antolín Camarena wrote:
>> Hi everyone!
>
> Hello, Omar!
>
>> I love the convenience of the SCSH process notation and would like to
>> be able to use it on Windows, but it currently uses process-fork
>> internally and this function is unavailable on native Windows chicken
>> builds. I was a little surprised that the run macro in scsh-process
>> uses process-fork, I expected it to use just the pipe functions from
>> the posix unit. Why doesn't it, is it just to share code with the &
>> macro or is there some obstacle to implement it using only the pipe
>> functions?
>
> The reason is that scsh-process is extremely flexible in how it
> allows you to wire up the input/output/error descriptors, via the EPF
> (extended process form) notation.  It's even possible to wire up
> nonstandard file descriptors to Scheme objects or different programs.
>
> If I were to add a special treatment for "simple" process forms, that
> would duplicate most of the code, I'm afraid.
>
>> Do people have any advice on getting the run macro from scsh-process
>> to work on windows (I guess the & macro would definitely be harder)
>> with a minimum of hassle? Should I install cygwin? (And then building
>> chicken, I guess, since the chicken in the cygwin package list is old:
>> 3.4) Try to reimplement (the subset I need of the functionality of)
>> run using only pipes?
>
> Maybe there's some way to get fork-like functionality on Windows?
> Then it could be "emulated" by the process-fork implementation of the
> POSIX unit on Windows.  That would require patching CHICKEN core,
> but once done it would make a lot of programs a lot more portable.
>
> Cheers,
> Peter
> --
> http://www.more-magic.net



-- 
Omar Antolín Camarena



reply via email to

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