| От | Andrew Chernow |
|---|---|
| Тема | libpq WSACleanup is not needed |
| Дата | |
| Msg-id | 496FB5FA.5070404@esilo.com обсуждение исходный текст |
| Список | pgsql-hackers |
WSACleanup is not really needed during a PQfinish. Its horribly slow if the library ref count is 0 and it actually unloadsthe winsock library, adds 225ms to PQfinish. Solution: A) Call WSAStartup once and never clean it up. When the app dies, so do the ref counts and winsock is automatically unloaded. B) Have a way of specifying the behavior, the way it is now or tell libpq to not initialize wsa at all (kinda like ssl init callbacks). Leave it up to the application. I think the WSA startup/cleanup stuff is silly. If I dynamically link with a DLL, I want it automatically loaded and cleaned up. Worst case, your app makes lots of connections to different backends. So, it is constantly doing PQconnectdb and PQfinish; only has a single conn open at a time. This means its constantly loading and unloading winsock. Andrew
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера