Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can i do a round robin scheduling of threads in VC++?

0
Posted

How can i do a round robin scheduling of threads in VC++?

0

I haven’t much experimented threads on Windows yet, but as far as I understand the SDK documentation, what you’re creating is this situation: Your programs is allocated a process containing all the ressources he needs to execute. Inside this process, you will create three threads which Windows will consider as pieces of executable code to which he can allot CPU time at its will. So, Windows is deciding when a thread runs. Not your application. All you can do is ask Windows to grant a level of priority to each of your thread. We could imagine a set of semaphores shared by the threads, so that each thread would know if it has to yield back to Windows as long as another of your threads – which you would temporarily consider as dominant – hasn’t ended it task. But I don’t know much, how you can compute the amount of CPU time a thread has been allotted up to some point. Edit: In fact, I think that infinite loops in threads are not a problem, because Windows must be pre-emptive now. That is,

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.