Page 2 of 2 FirstFirst 12
Results 21 to 27 of 27
  1. #21  
    I would think that you would need to statically link to librt, but if you want to make sure I recommend you ask in the official forums.

    Actually, now that you have libcurl working on device, I have a question for you. In my app, I've noticed that whenever my app starts downloading a file, it's CPU usage jumps from ~0% to ~20%. I've browsed the libcurl documentation to see how I can improve performance but this problem is still beyond me. I'm wondering if you've experience this problem as well, and if you have, have you managed to get libcurl to make a download without such a high CPU usage?
  2.    #22  
    Quote Originally Posted by rsanchez1 View Post
    I would think that you would need to statically link to librt, but if you want to make sure I recommend you ask in the official forums.
    Do I have to compile librt for statically linking, or is that done by -static -lrt?

    Quote Originally Posted by rsanchez1 View Post
    Actually, now that you have libcurl working on device, I have a question for you. In my app, I've noticed that whenever my app starts downloading a file, it's CPU usage jumps from ~0% to ~20%. I've browsed the libcurl documentation to see how I can improve performance but this problem is still beyond me. I'm wondering if you've experience this problem as well, and if you have, have you managed to get libcurl to make a download without such a high CPU usage?
    Do you use it in a hybrid app? I only tried it with manually executing via novaterm. When I have done all my libcurl functions I'll put that in a PDK plugin.
    I haven't looked into CPU usgae, but I'll do that.
  3. #23  
    Yeah I use it in a hybrid app. It wouldn't be such a big problem, except that when a download starts the UI becomes sluggish.

    Also, I think whenever you compile one library for static linking, I think you do have to compile all dependencies for static linking as well.
  4.    #24  
    I didn't find any source code for librt.

    Do you use C++ threads for downloading?
  5. #25  
    Curl runs on a separate thread when it downloads files.
  6. #26  
    Just wanted to comment on how I got around this. Before, I used to have a progress function set for curl so I can track how much of the file was downloaded. After some debugging, I found that it was the progress function that was taking up a lot of CPU time. I switched from using the progress function to getting the total file size from the HTTP header, then using a write function to track how much of the file has been downloaded yet. This is essentially what was passed to the progress function, but for some reason it doesn't take a lot of CPU time. Go figure.
  7.    #27  
    Thanks, this sounds good, I'll try it.
    I'm still writing the plugin, I have to learn how to use posix threads since I'm a noob in C(++).
Page 2 of 2 FirstFirst 12

Posting Permissions