While I agree that we should avoid telling people to "just use threads", I
think Chris was instead informing the OP that their desired behavior is
already present in threads, and if they don't want to be concerned at all
about context switching, OS threads should be considered as an alternative.
Of course, this doesn't take into account the lower memory usage of
coroutines, the shorter context switching delay, etc. But that's not
necessary for all use cases.

On Fri, Jun 12, 2020 at 10:11 PM Greg Ewing <[email protected]>
wrote:

> On 13/06/20 9:37 am, Chris Angelico wrote:
> > If you don't care where the context
> > switches happen and just want everything to behave sanely by default,
> > use threads, not coroutines.
>
> There are other reasons for using coroutines, such as the fact that
> they're very lightweight compared to threads. Telling people to
> "just use threads" without knowing more about their use case is
> not helpful.
>
> --
> Greg
> _______________________________________________
> Python-ideas mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/[email protected]/message/QWUWDA7L6LOZR2VW7JIM2RYI7L7N5W2B/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/3K54K7B5FKOHJX266EAYD6NN27E7OPLQ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to