0
hi is anyone know round robin algorithm program ???in c++
5 odpowiedzi
+ 1
Probably one of the easier ways to get the source code of a very well tested implementation would be to look up the round robin scheduler from the Linux kernel that is freely available as Linux is open source. Nevertheless, the Linux kernel is not written in C++ but in C.
For an own implementation, you need three things:
1) a means to to be signalled after a certain time has passed
2) a means to preempt *any* thread
3) a means to store thread state
No such means is provided by standard C++03 which is usable here at SoloLearn C++. Furthermore, you very likely program against a target operating system that prevents access to preempting other threads. Therefore be aware that you can only do this directly on hardware (as the operating system does) or as an extension to the operating system kernel.
Consequencially, I can't give you code for a round robin scheduler but I hope you understand that just for the infrastructure w/o the scheduler quite a bit of code would be required.
Even for limited functionality, support libraries and coding that is *far* beyond SoloLearn C++ and unsuitable for a forum format is required.
0
You mean the code for a round robin scheduler?
0
yes
0
thanku stefan
0
No problem. 😀