ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Does anyone know how to run 2 threads with round robin scheduling. & can we get the time of these threads when they are context switching. That means I want to know at how much time each thread is taking to run
Whether or not the scheduling is round-robin, ways of observing the time consumed by processes or threads do exist. (You need to tell us exactly what threading system you're using...)
Of course, even if scheduling is set up to be "round robin," you should not expect to see that "first this thread runs, then that thread runs." The scheduling discipline is, basically, a suggestion to the scheduler. Actual observed behavior depends upon the actual environment ... and, upon whether or not you are looking at it. (Yes, "the presence of the experimenter affects the experiment." If the little mice can see you, they'll stop doing what they're supposed to be doing and look back at you with a little mousey smile, hoping for another piece of cheese.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.