Hi,
I need to suspend the current thread if there exists a high priority thread, How can I do that.I need to suspend that thread and execute the new high priority thread first then after it accomplished, then resume earlier one.
Hi,
I need to suspend the current thread if there exists a high priority thread, How can I do that.I need to suspend that thread and execute the new high priority thread first then after it accomplished, then resume earlier one.
http://stackoverflow.com/questions/1916792/how-can-i-stop-a-thread-in-c/1916857#1916857
you are confusing the concept of "thread", and "opperation" what you want is to sync opperations...
nice source on threading:
I need to suspend the current thread if there exists a high priority thread
That's not how threads work. They're supposed to run in parallel, with high priority threads given more time - the OS does that automatically for you. You shouldn't try to interfere with that, especially since nowadays most computers have multiple cores and giving one thread absolute priority won't even make it execute faster.