Eric Brunson wrote:
> I mention that because when you combine a fork with an exec, you get a 
> spawn.  Your parent process duplicates itself, but the child process 
> chooses to exec another process.  So the child copy of the initial 
> process is replaced by new running binary and you have a spawned process 
> running as a child of the first.

The subprocess module provides another way to do this.

> The interesting thing about a python thread is that it is not an OS 
> level thread,

Not true; Python threads are OS threads.

> it is a separate execution thread, but still controlled by 
> the python interpreter. 

Yes, it is running the interpreter.

> So, while a dual processor computer can choose 
> to execute two different processes or thread simultaneously, since 
> there's only one python interpreter (per python process) a python thread 
> is never run concurrently with another thread in the same python 
> process.  It's more of a conceptual thing,

The interpreter will never execute Python code in two threads at the 
same time. But if one thread is blocked for I/O or sleep() another 
thread will run, and it is possible for one thread to be running C code 
in an extension while another thread is running Python code in the 
interpreter.

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to