lundi 24 septembre 2018

Is a single LibCurl Interface in a Multi Threaded program or a Multi LibCurl Interface in a single threaded program more efficient?

I am working on a program where I am required to download a large amount of JSON files from different URLs.

Currently, my program creates multiple threads, and in each thread, it calls the LibCurl easy_perform() function but I am running into issues where the program fails occasionally with an error of "double free". It seems to be some sort of Heisenbug but I have been able to catch it in GDB which confirms the error originates in LibCurl (backtraced).

While I would love suggestions on the issue I am having, my actual question is this: Would it be better if I were to change the structure of my code to use the LibCurl Multi Interface on one thread instead of calling the single interface across multiple threads? What are the trade offs of using one over the other?

Note: By "better", I mean is it faster and less taxing on my CPU? Is it more reliable as the multi interface was designed for this?

Aucun commentaire:

Enregistrer un commentaire