Setting a higher priority will take you nowhere. Unless you get a customized kernel for your OS, I see no way for you to force a thread not to be re-scheduled in favor of another thread.
About the "(because windows is oh so smart)" part, I suggest you try it on another multi-tasking operating system and then come back to us and show how you did it. We are eager to hear about that
![[bigears] [bigears] [bigears]](/data/assets/smilies/bigears.gif)
.
Our issue is that we have a separation of interests and have many little tools doing repetitive work on separate threads. They are not trying to access the same function but they are trying to run through to completion and give up the CPU at that time.
If what you want would be possible, and you have let's say 3 threads, it would work like this:
* Thread1 runs to completion and since there is no multi-tasking (that's what you want, basicly) Thread2 and Thread3 are waiting for processor time since Thread1 cannot be re-scheduled;
* Thread1 has finished running;
* Thread2 runs to completion while Thread3 waits for the above specified reasons;
* Thread2 has finished running;
* Thread3 runs freely
It looks like single threading programming to me... So please answer these:
1. Have you tried running all those little tools in a sequence?
2. You realize, of course, that *NOT* letting the kernel scheduler to re-schedule your thread and let yours wait for a while, the system will appear to freeze until the completion of your thread? (No async calls and by that I mean I/O, no GUI response, nothing...)
3. Do you realize that even in a single threaded operating system, your thread gets somehow "re-scheduled" when a low level hardware interrupt was issued by let's say a device/controller? The OS (i.e. MS-DOS) would save the state of the currently executing "thread" and execute the specified interrupt...
4. Have you considered re-designing your code? Something is pretty fishy if you require complete, total, unrestricted and exclusive access to the processor...
Maybe more information would help us help you. Why don't you elaborate a little bit?