Threading plus multiprocessing plus cv2 error

Chris Angelico rosuav at gmail.com
Sun Aug 30 02:03:32 EDT 2020


On Sun, Aug 30, 2020 at 4:01 PM Stephane Tougard via Python-list
<python-list at python.org> wrote:
>
> On 2020-08-29, Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:
> >       Under Linux, multiprocessing creates processes using fork(). That means
> > that, for some fraction of time, you have TWO processes sharing the same
> > thread and all that entails (if it doesn't overlay the forked process with
> > a new executable, they are sharing the thread until the thread exits).
> > same error condition even with the sleep(1) in place.
>
> I'm not even that makes sense, how 2 processes can share a thread ?
>

They can't. However, they can share a Thread object, which is the
Python representation of a thread. That can lead to confusion, and
possibly the OP's error (I don't know for sure, I'm just positing).

ChrisA


More information about the Python-list mailing list