Hi,

On Tue, 25 Feb 2020 11:48:44 -0000
e2la...@gmail.com wrote:
> Hello,
> 
> I have successfully built Python 3.8.1 on QNX, but ran into a problem when 
> using 'make -j4'. The build process invariably hangs with multiple 
> single-threaded child processes stuck indefinitely waiting on semaphores. 
> These semaphores will clearly never be posted to, as the processes are all 
> single threaded and the semaphores are not shared with any other process.
> A backtrace shows that the the offending calls come from run_at_forkers(), 
> which is not surprising. I consider a multi-threaded fork() to be an 
> ill-defined operation and my arch-nemesis...

Can you post the detailed backtrace(s) somewhere?
Otherwise nobody will be able to dive deeper.

> 3. Any reason not to use posix_spawn() instead of fork()/exec()? While some 
> systems implement posix_spawn() with fork()/exec() others (at least QNX) 
> implements it without first creating a duplicate of the parent, making it 
> both more efficient and safer in a multi-threaded parent.

Well, subprocess can do so in some cases:
https://bugs.python.org/issue35537

I'm not sure what can prevent it here, but you're welcome to
investigate.

> 4. thread_pthread.h seems to go to great lengths to implement locks without 
> using native mutexes.

Python locks are not like mutexes.  They can be locked from one thread
and unlocked from another, so they're more like binary semaphores.

Regards

Antoine.

_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/UZUUWLWZSODZHBKQL257EW26JLOQCQFR/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to