Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use bcos_sdk_create to create and start sdk costing 100% cpu with empty run #221

Open
Keyon11 opened this issue Mar 11, 2024 · 1 comment
Labels

Comments

@Keyon11
Copy link
Contributor

Keyon11 commented Mar 11, 2024

Describe the bug
I modify hello_sample.c with following code found that program always costing 100% cpu when sleep waiting for free sdk.

    // 1. create sdk object by config
    void* sdk;
    if (strlen(config) == 0) {
        struct bcos_sdk_c_config* cfg = bcos_sdk_create_config(1, "172.25.0.3", 20210);
        sdk = bcos_sdk_create(cfg);
    } else {
        sdk = bcos_sdk_create_by_config_file(config);
    }
   ... 
  sleep(300);
 //before bcos_sdk_c_free

To Reproduce
Steps to reproduce the behavior:

  1. check out branch main
  2. modify hello_sample.c as above and fix host:port
  3. compile and run hello_sample
  4. use command 'top' to see hello_sample cpu cost

Expected behavior
no empty run cost

Screenshots
none

Environment (please complete the following information):

  • OS: [e.g. CentOS 7.9]
  • fisco-bcos Version [3.2.1]

Additional context
none

Keyon11 pushed a commit to Keyon11/bcos-c-sdk that referenced this issue Mar 11, 2024
@kyonRay
Copy link
Member

kyonRay commented Mar 12, 2024

Mentioned in #222

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants