OS Threads Scheduling
-
I want to enforce the OS, not to suspend a special thread during execution a set of operations, in a ,multithread program in c++.(all of my threads has the Realtime priority) OS: WinXP IDE: VS 2005
-
I want to enforce the OS, not to suspend a special thread during execution a set of operations, in a ,multithread program in c++.(all of my threads has the Realtime priority) OS: WinXP IDE: VS 2005
I'm not sure I understand your question very well. What you would like to do is in fact that when you process a certain set of operations, disable thread switching (so that no other thread is processed until you have finished to process your set of operations). Is that what you want to do ? If yes, then I'm almost certain you can't do that. But there are other mean to achieve a similar result: if the only thing you want to do is to avoid that two threads of your program access the same 'resource' (whatever it might be) at the same time, then you can simply use a critical section to protect the access of said resource.
Cédric Moonen Software developer
Charting control [v1.3 - Updated] -
I'm not sure I understand your question very well. What you would like to do is in fact that when you process a certain set of operations, disable thread switching (so that no other thread is processed until you have finished to process your set of operations). Is that what you want to do ? If yes, then I'm almost certain you can't do that. But there are other mean to achieve a similar result: if the only thing you want to do is to avoid that two threads of your program access the same 'resource' (whatever it might be) at the same time, then you can simply use a critical section to protect the access of said resource.
Cédric Moonen Software developer
Charting control [v1.3 - Updated]Actually i am working on my program performance. I want to know how much does it take to execute a set of operations in a thread, when 6 threads are running the same set of operations. I hace a timer for each thread, which starts at the beginning of these operations and stops at the end of these operations. but because of time slicing the timer value does not show the time executed by the same thread.
-
I want to enforce the OS, not to suspend a special thread during execution a set of operations, in a ,multithread program in c++.(all of my threads has the Realtime priority) OS: WinXP IDE: VS 2005
You would need to add functionality to the operating system scheduler to accomplish this and since Microsoft operating systems are closed source, it is doubtful at best that you would be able to see and modify the source for your intended purpose. What is the reason that the thread operations are critical? Is it that they need to be executed in order? Do they need to be executed one right after another? If yes is the answer to either of the last two questions, then critical sections is the answer your looking for.
Phil