-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/24/2014 05:17 PM, Jack Murray wrote:
> Apologies for digging up old thread.
> 
> I notice that in python 3.4, asyncio spawns a new thread in this
> situation:
> 
> print("Threading, before:",threading.active_count()) self._server =
> yield from self._loop.create_server(lambda: self, *self._address) 
> print("Threading, after:",threading.active_count())
> 
> That is called in a coroutine running in self._loop. I am confused
> about this behaviour.. is there a way to get the accept loop for
> the server running in the same thread? What I want is to ensure
> that any coroutine touching this object is being run in the same
> thread, including all connections and their handlers.
> 

I suspect the created thread is just a ThreadPoolExecutor thread used
to do getaddrinfo. The asyncio event loop will run in a single thread.

- -- 
Saúl Ibarra Corretgé
bettercallsaghul.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iQIcBAEBAgAGBQJTWSy0AAoJEEEOVVOum8BZCkYP/1E2FM2qSSjOaYqkqGYZRAL/
fWFRKk72deV6Vikm11HrUVg7igMGB0iwUePKkWAq/PCVzs7kdkicpMSH2lrWO5HS
ObNP0vGCtT7RvfrMfMM1txeLiw1X6F0DDKVLVg0Lgheudh0dnh3wL1q7ofWEI+Dr
h7kkSujmyhVgaCC9ThpX1SC35YcyF1fD+7qui0XyigqdagsCq3sUkA7ELDeEG671
Tq3VUYlmtWBNRUtw296Ha8yrWBoK7IXhxmcyluL/QZk5BzneEqcHHguYgXMJ6Dxd
19vBgv5WmmmiPo0cSBEJ4yk1uwaOuwb0pXqmIZMrwTRLyzHZHgJs6eEEGPYKWmbb
N8UgVGmceG94lNAjGL19rPwztC82OGGLCssKXlTMrRWe49cWwqTjgALGiFLi9xAi
Sj36zYY9yiqTzGsfv/MkMyQI2Blk/z4JC+rAw61Hzw3NEUokLLA/X84FewFq5xIy
6ErcOX2fx8yV79YEPnaZtEtV/jQ6IyTL55zsyeM2lYmx9LXhxLIHcz48WRRLwo4D
ZUVhvzdG7WzH8BFiD55WrgpPDirTuNwriLcHyQZe45nr00DvuMxrEERmxAJfG9KE
ZUZutveVxFXt1b64rLfvUR5YiwD/HZbH7hCZBIzGWfnfBU7jiglmYM3zL3fbhNic
V8y2cUEVo5L9Qn6qG6Hj
=egyk
-----END PGP SIGNATURE-----

Reply via email to