[Stackless] stackless fork() for windows?

Anselm Kruis a.kruis at science-computing.de
Thu Oct 24 21:50:15 CEST 2013


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
>

-- 
  Dipl. Phys. Anselm Kruis                       science + computing ag
  Senior Solution Architect                      Ingolstädter Str. 22
  email A.Kruis at science-computing.de             80807 München, Germany
  phone +49 89 356386 874  fax 737               www.science-computing.de
-- 
Vorstandsvorsitzender/Chairman of the board of management:
Gerd-Lothar Leonhart
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Michael Heinrichs, 
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Philippe Miltin
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196




More information about the Stackless mailing list