Open
Description
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:
- check out branch main
- modify hello_sample.c as above and fix host:port
- compile and run hello_sample
- 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