How hard to allocate ALL Python data space (hence offset-based) in a memory mapped file image?

Manuel M. Garcia mgarcia at cole-switches.com
Thu Dec 19 13:24:15 EST 2002


On 19 Dec 2002 06:51:08 GMT, bokr at oz.net (Bengt Richter) wrote:
(edit)
>Checkpointing using a call to sys.checkpoint('mydist.pyk') would create
>the file (without argument, it would just flush the current image back to
>its file (which must have been started with -k option or have had the new
>file specified as a second file arg to -K, otherwise it's a programming
>error or leaves an unrenamed temp file)). The file would include whatever
>state necessary to come back to the caller through the last sys.checkpoint()
>call when relaunched via e.g.,
>
>    python -k mydist.pyk
>
>which would magically continue after the sys.checkpoint call and mydist.pyk
>would be the relevant mapped file ;-)

Wow! This would be fantastic! It would end defininately all the
complaints about Python's slowness at startup.

But I think Martin v. Löwis is correct.  CPython also keeps critical
information on the C stack, so CPython data is mixed in with other
data on the stack in an OS dependent way.

I don't know if Jython or Stackless would be able to do
sys.checkpoint().  But it is more feasable for Jython or Stackless to
do this than CPython.

Manuel



More information about the Python-list mailing list