Unsolved how can I put a thread within a class for a library
-
The thing is I just want the thread to go into the class and disable the thread from being created outside of it.
-
@AI_Messiah said in how can I put a thread within a class for a library:
The thing is I just want the thread to go into the class and disable the thread from being created outside of it.
Can you please provide more details? What is the purpose of the thread? How long should the thread run for?
-
Well I want to do a lot of operations within a class. So I mean for eternity unless it is told to stop, but I just want one thread. I would like to have other members inside it that run in on their own time. I know about mutex.
-
@AI_Messiah said in how can I put a thread within a class for a library:
Well I want to do a lot of operations within a class.
What type of operations? What is the benefit of running them in another thread instead of running them in the main thread? (For example: Using Qt, even things like networking and serial port communications can be done efficiently in the main thread)