>
>
>
> In general, if you're writing performance-sensitive code, you should
> not use deferToThread.  Instead, you should use deferToThreadPool:
>
>
> https://twistedmatrix.com/documents/current/api/twisted.internet.threads.html#deferToThreadPool
>
> That's because the reactor's threadpool, which deferToThread uses,
> also handles things like DNS lookups.  That means other parts of your
> Twisted program will compete with your performance-sensitive code.  To
> ensure that your performance-sensitive code gets the best chance to
> run it should be given its own thread pool, which *only* runs that
> code.  I'll use such a thread pool in my version of your test program.
>
>
>
>
> https://gist.github.com/markrwilliams/2e40ed0fa06a9e653609dd61fd80ca95#file-simple_threadpool-py
>
>
>
>
Hi Mark

     You mentioned deferToThreadPool. I am curious whether the standard
threadpool in multipleprocessing.dummy works with twisted.

Regards

gelin yan
_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to