Python child process in while True loop blocks parent
Peter J. Holzer
hjp-python at hjp.at
Sun Dec 5 21:08:31 EST 2021
On 2021-12-06 00:51:13 +0100, Jen Kris via Python-list wrote:
> The C program creates two threads (using pthreads), one for itself and
> one for the child process. On creation, the second pthread is pointed
> to a C program that calls fork-execv to run the Python program. That
> way Python runs on a separate thread.
I think you have the relationship between processes and threads
backwards. A process consists of one or more threads. Fork creates a new
process and therefore also a new thread.
hp
--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp at hjp.at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://mail.python.org/pipermail/python-list/attachments/20211206/47612757/attachment.sig>
More information about the Python-list
mailing list