Using the sdk in multithreading #2355
Answered
by
jmklix
Gribouillages
asked this question in
Q&A
-
Used in a multithreaded Aws: : InitAPI/Aws: : ShutdownAPI to crash the program. std::thread thread1([&] {
Aws::SDKOptions option;
Aws::InitAPI(option);
// code ..
Aws::ShutdownAPI(option);
});
std::thread thread2([&] {
Aws::SDKOptions option;
Aws::InitAPI(option);
// code ..
Aws::ShutdownAPI(option);
});
thread1.join();
thread2.join();
|
Beta Was this translation helpful? Give feedback.
Answered by
jmklix
Feb 21, 2023
Replies: 2 comments
-
You should only be initializing and shutting down the API once per application. You can read more about this here. Please let me know if you have any more problems using this sdk. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Gribouillages
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should only be initializing and shutting down the API once per application. You can read more about this here. Please let me know if you have any more problems using this sdk.