I'm new here. And I would like to write a Code so
the functions are computed parallel 2 or more functions.
If there only void Functions and there not changing an Member Variables of the
class its working with detach.
How would it work with a int or other function ?
or when I want to change a member variables ?
Thank you for your help
Best Regards
CHris
If you need to share a data between threads or to change a common variable, then synchronization with, for example, mutex must be used. It's not a very small topic with a lot of details, so I suggest reading some C++ book about multithreading. Shortly, to work with common struct you would need something like: