Re: [Python-Dev] Python startup time - daemon

2018年5月11日 08:30:34 -0700

On Fri, May 11, 2018 at 07:38:05AM -0700, Chris Barker - NOAA Federal via 
Python-Dev <[email protected]> wrote:
> Could one make a little startup utility that, when invoked the first
> time, starts up a raw python interpreter, keeps it running somewhere,
> and then forks it to run the actual python code.
> 
> Then every invocation after that would make a new fork.
 Used to be implemented (and discussed in this list) many times. Just
a few examples:
http://readyexec.sourceforge.net/
https://blogs.gnome.org/johan/2007/01/18/introducing-python-launcher/
 Proven to be hard and never gain any traction.
a) you don't want the daemon to import all possible modules so you need
 to run a separate copy of the daemon for every Python version, every
 user and every client program;
b) you need to find "your" daemon - using TCP? unix sockets? named pipes?
b) need to redirect stdio to/from the daemon;
c) need to redirect signals and exceptions;
d) have problems with elevated privileges (how do you elevate the daemon
 if the client was started with `sudo -H`?);
e) not portable (there is a popular GUI that cannot fork).
> -CHB
> Sent from my iPhone
Oleg.
-- 
 Oleg Broytman http://phdru.name/ [email protected]
 Programmers don't die, they just GOSUB without RETURN.
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to