[Stackless] stackless fork() for windows?

Christian Tismer tismer at stackless.com
Fri Oct 25 00:17:29 CEST 2013


Hi Anselm,

thank you very much for the hint!

I think for the use case it will be sufficient, since there is no real
fork() necessary (but I need to look deeper).
Victor uses fork() to run a function call in a subprocess, so this
is not exposed to the user as a general purpose fork, but just a helper
to make a call in the same context. (I hope)

And if that is true, then I can fake everything well enough, even in a 
nested
interpreter context (I think), if just the one call needs to work.
After the call, the subprocess will kill itself... ;-)

I will grab the checkpoint code, now.

Probable this is more like a "chip fork" (was heisst Gaebelchen?)

forklet :-D

thanks a lot - Chris


On 24.10.13 21:50, Anselm Kruis wrote:
> Hi Christian,
>
> I have no experience with pysandbox and I'm not very confident, that 
> it is possible at all to lock down a python installation completely.
>
> But for your question: you can simulate something like POSIX fork() 
> using Stackless Python and sPickle. But there are limitations:
> - you must not have C-state on the stack
> - the child process does not inherit IO resources like open files, 
> sockets, ...
> - the performance is low compared with a real fork.
> - you can't fork the main tasklet
>
> The examples folder of sPickle contains a checkpointing example, that 
> could serve as a starting point.
>
> Cheers
>   Anselm
>
>
>
> Am 24.10.2013 21:15, schrieb Christian Tismer:
>> Hi Kristjan, Anselm et al.,
>>
>> just had a look into stacklesslib, searching a fork() function.
>> Maybe sPickle is the way to go? Looking there as well right now.
>>
>> Reason:
>> I am evaluating pysandbox from Victor Stinner which is quite functional,
>> but missing some spots on windows.
>> Unfortunately, although it uses subprocess, in a call() with subprocess
>> it uses fork() :-(
>>
>> And as always, I need that stuff on windows, sooo,
>> why not emulating fork, instead of re-writing things.
>>
>> And btw., do you have experience with pysandbox, or should I use
>> something else for semi-protected code?
>>
>> cheers & thanks - chris
>>
>


-- 
Christian Tismer             :^)   <mailto:tismer at stackless.com>
Software Consulting          :     Have a break! Take a ride on Python's
Karl-Liebknecht-Str. 121     :    *Starship* http://starship.python.net/
14482 Potsdam                :     PGP key -> http://pgp.uni-mainz.de
phone +49 173 24 18 776  fax +49 (30) 700143-0023
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
       whom do you want to sponsor today?   http://www.stackless.com/




More information about the Stackless mailing list