http://curl.haxx.se/libcurl/c/persistant.html
http://curl.haxx.se/libcurl/c/multi-app.html
这个功能是否必要?
解决方法 如果它被设计,将是必要的. documentation说:This function must be called at least once within a program (a program is all the code that shares a memory space) before the program calls any other function in libcurl. The environment it sets up is constant for the life of the program and is the same for every program,so multiple calls have the same effect as one call.
但请注意,在curl_easy_init的文件中:
总结If you dID not already call curl_global_init(3),curl_easy_init(3) does it automatically. This may be lethal in multi-threaded cases,since curl_global_init(3) is not thread-safe,and it may result in resource problems because there is no corresponding cleanup.
以上是内存溢出为你收集整理的什么时候需要curl_global_init()?全部内容,希望文章能够帮你解决什么时候需要curl_global_init()?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)