On 20 April 2012 20:39, Pham, Hien <[email protected]> wrote:
> The problem is when it is compiled with cx_freeze,  for each “is_prime”
> process is called, the complied application re-launch itself instead of
> execute the “is_prime” in a new process.

Sorry for the delayed reply. I don't have a solution, but an insight
into what the problem might be.

On POSIX platforms (i.e. Linux/Mac), Python's multiprocess
architecture can create multiple proceses by forking: splitting
existing processes in two, so the new process inherits the variables.
On Windows, that's not possible, so it tries to launch a new Python
process and load copies of the variables. I guess it looks at
sys.executable to make sure it uses the same Python interpreter. But
when you run a frozen program, sys.executable points to the exe for
your program. So it tries to launch extra instances of Python, and
launches your application instead.

Thomas

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
cx-freeze-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users

Reply via email to