-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Calling Aws::initAPI() spawns multiple threads #1854
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
Comments
Did a bit more investigation, and was able to limit the threads via:
|
Hi @dbowman-ion , |
Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one. |
Yes, understanding why would be nice. I ended up finding the answer in aws-sdk-cpp-core/source/Aws.cpp |
Hi, I guess I have the same issue in my case. #include <aws/core/Aws.h> static Aws::SDKOptions options; main(){ Trace: |
This problem occurs when the InitAPI and ShutdownAPI are not in the same thread。 |
Can you make sure you are using the sdk correctly as show in the docs: #include <aws/core/Aws.h>
int main(int argc, char** argv)
{
Aws::SDKOptions options;
Aws::InitAPI(options);
{
// make your SDK calls here.
}
Aws::ShutdownAPI(options);
return 0;
} |
Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one. |
Uh oh!
There was an error while loading. Please reload this page.
It appears that a call to Aws::initAPI() spawns '# cpu cores / 2' threads but so far I've been unable to find any documentation on how or why this happens, or how to configure it.
We spawn multiple process that call Aws::InitAPI and on a high cpu count machine this results in more than 2000 threads spawned by the SDK. As threads/PID's are not an infinite resource, any advice on how to remove/limit this behaviour would be appreciated.
Minimal reproducable example:
Compile & run and then do a pstack on its pid, you'll see multiple threads like:
The text was updated successfully, but these errors were encountered: