[Closed] multi-threading c++ sdk discussion no code
I know the guys at Autodesk say there is no way to use multi-threading in the SDK.
Now, they are talking about the 3ds Max SDK functions can’t be multi-threaded.
If you need to do some heavy math functions you could…
1 – Write a .DLL to manage you multi-threading. (Not sure how well this would work inside the 3ds Max plugin)
2 – Send info to a silent running console app via text file or sockets.
I’m guessing second one is the best.
Would anyone try openCL or standard threads
Any thoughts would be interesting.
Si
Multi-threading in an SDK plugin is pretty easy to do. You can use STL threads, OpenMP, TBB, or whatever MT library you prefer. Many CORE functions can be integrated into multi-threaded code, it’s just that not all of them are thread-safe and Autodesk makes no guarantees about which ones are, for the most part. So you have to test and see which ones work and which ones cause problems. But your own functions and code can be multi-threaded.
But maybe I’m misunderstanding your question…?
Thanks Ivanisavich,
When I had a chance to talk to some of the dev team at autodesk, they said just to even try to do threading in your plugins. I though okay, we could send stuff to our own .exe and let it do the threading. I was good to read that they are wrong and we can do our own math and maybe some SDK functions in our plugin.
I will start to play around with the Standard Threading functions.
What do you like to use? OpenMP?
Thanks
Si
Hmm, that’s an odd thing for them to say…maybe you misunderstood what they meant?
There are tons of 3rd party plugins that are multithreaded. VRay, Thinking Particles, PhoenixFD, Krakatoa, etc etc. There is absolutely no issue with threading in a max plugin, so long as you understand the limitations of it and don’t try to call thread-unsafe API functions.
I use STL threads in a custom threadpool implmentation. They’re fast and flexible.
Thanks for your incite in this topic.
We have been working with just the STL threads all day and have had no problems. Crazy good speed.
Thanks again
Si