using C++11 std::thread [CLOSED]

On 27/11/2014 at 14:04, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   13+ 
Platform:   Windows  ; Mac  ;  Mac OSX  ; 
Language(s) :     C++  ;

I understand that it is advised not to use exceptions in external dlls, and I wanted to use std::thread "which throws lots of exceptions" , is this possible? or I misunderstand something

On 28/11/2014 at 02:47, xxxxxxxx wrote:

Hello Mohamed,

theoretically it is possible to use std::thread. But we won't be able to support you with this.

I personally never tried this, but I guess, there are numerous pitfalls. Beginning with project setup and configuration (by default exceptions are disabled in example plugin projects) and then with the exceptions themselves. It is not easy at all, to handle exceptions correctly in a multithreaded environment. For example any cleanup needed after an exception can cause a plethora of bugs, if not done correctly.

Please understand, that it's not easy for me to answer this question. I don't know your skills, nor do I know, what you are trying to achieve in the end. Thus I can not recommend to try this and I have to stress once again, that the SDK Support Team can not help with this. It is simply beyond our scope. Sorry.

On 28/11/2014 at 03:23, xxxxxxxx wrote:

the whole threading work will be in an external dll "which will get called from a Cinema 4D plugin dll"

On 28/11/2014 at 03:29, xxxxxxxx wrote:

Well, then the threading (and event handling) is encapsulated in that library, and internally the library does not interact with C4D? While your C4D plugin is only using an interface to interact with the library?So you don't even have to enable exceptions in your C4D plugin project? Then I think, this should work fine.

Still the bottom line remains, we can't help with external libraries. Sorry.

On 28/11/2014 at 03:33, xxxxxxxx wrote:

I totally understand Smile that you can't help with external libraries.
was making sure that external dlls that got exceptions are fine, the C4D plugin itself will has no exceptions.

thanks for the help Andreas.