更新时间:2021-12-10 23:17:09
在某些系统上,getaddrinfo不是线程安全的. Python认为其中一些系统是FreeBSD,OpenBSD,NetBSD,OSX和VMS.在这些系统上,Python专门为netdb(即getaddrinfo和好友)维护一个锁.
On some systems, getaddrinfo is not thread-safe. Python believes that some such systems are FreeBSD, OpenBSD, NetBSD, OSX, and VMS. On those systems, Python maintains a lock specifically for the netdb (i.e. getaddrinfo and friends).
因此,如果您不能切换操作系统,则必须使用其他(线程安全的)解析器库,例如twisted的解析器库.
So if you can't switch operating systems, you'll have to use a different (thread-safe) resolver library, such as twisted's.