[issue34411] ProactorEventLoop should use implement GetAddrInfo, GetNameInfo

2018-08-15 Thread Yury Selivanov
Yury Selivanov added the comment: > Is netdb_lock the GIL? No, it's a lock used by getaddrinfo specifically on *some* platforms. It doesn't look like it's used on Windows. > If the thread pooling was effective, the slowdown wouldn't be linear, but it > does indeed appear to be. How can

[issue34411] ProactorEventLoop should use implement GetAddrInfo, GetNameInfo

2018-08-15 Thread ysangkok+launchpad
ysangkok+launchpad added the comment: The lock I was referring to is https://github.com/python/cpython/blob/e0b5b2096ead4cc094a129ce7602ac5c0e998086/Modules/socketmodule.c#L222 Is netdb_lock the GIL? If the thread pooling was effective, the slowdown wouldn't be linear, but it does indeed

[issue34411] ProactorEventLoop should use implement GetAddrInfo, GetNameInfo

2018-08-15 Thread Yury Selivanov
Yury Selivanov added the comment: > As far as our experiments show, the requests are blocking each other > irrespective of thread pool size. Which is expected since the lock is global > across threads. It looks like you don't understand how GIL works in Python (sorry if I'm mistaken). The

[issue34411] ProactorEventLoop should use implement GetAddrInfo, GetNameInfo

2018-08-15 Thread ysangkok+launchpad
ysangkok+launchpad added the comment: As far as our experiments show, the requests are blocking each other irrespective of thread pool size. Which is expected since the lock is global across threads. Am I correct in assuming that an implementation for the ProactorEventLoop with IOCP would

[issue34411] ProactorEventLoop should use implement GetAddrInfo, GetNameInfo

2018-08-15 Thread Yury Selivanov
Yury Selivanov added the comment: > so that they wouldn't block the whole event loop. The aren't blocking it now as they are executed in a thread pool. -- ___ Python tracker

[issue34411] ProactorEventLoop should use implement GetAddrInfo, GetNameInfo

2018-08-15 Thread ysangkok+launchpad
New submission from ysangkok+launchpad : Since socket.getaddrinfo and socket.getnameinfo take a lock on Windows, it would be nice to have their corresponding methods in asyncio.ProactorEventLoop use IOCP, so that they wouldn't block the whole event loop. Overlapped I/O flags are available,