How to use two threads (GUI and backend)

Chris Angelico rosuav at gmail.com
Thu Oct 27 08:55:06 EDT 2016


On Thu, Oct 27, 2016 at 11:33 PM, jmp <jeanmichel at sequans.com> wrote:
> On 10/27/2016 01:43 PM, Chris Angelico wrote:
>>
>> Blocked threads don't consume CPU time. Why would they?
>>
>> ChrisA
>>
>
> Agreed. My point being that a blocked thread achieve nothing, except
> parallelism, i.e. other threads can be processed.
>
> To be more specific, if you compute factorial(51354) in a thread, it will
> still require approx. the same amount of CPU clocks than in a main thread
> (probably slightly more due to the scheduler overhead).
>
> jm

Of course. But the OP wants to do blocking calls, which don't cost you
like that. So it's fine.

ChrisA



More information about the Python-list mailing list