Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Can any one please clear me out how Multithreading is useful in Uniprocessor system(Except the I/O event scenario).as the main aim of multithreading is parallel processing.
"Multithreading on a uniprocessor machine" really isn't for "parallel processing." You are not multiplying the CPU resource: you are dividing it.
The main thing that multithreading gives you is the opportunity to overlap input/output (I/O) operations. Most processes actually spend most of their time waiting on something-or-other, and multithreading enables other units of work to be dispatched while others are waiting.
Often, what actually happens is that each process wakes up, evaluates the result of the I/O operation that it had just completed, then sets-up and starts another I/O operation and goes back to sleep again, having consumed only a negligible amount of CPU time in the interim. (We call these workloads, "I/O-bound," since their completion time is mostly tied to the speed of the I/O subsystem.
Some multithreaded scenarios also involve so-called "CPU-bound" activities that really do burn-up all the CPU time that they can get. By assigning an inferior dispatching-priority to these, we allow them to "run in the background," consuming their full time-slices whenever they can get them but immediately yielding control of the machine to other, more-interactive tasks.
As long as the various units of work are not competing for the same resource, and as long as their combined impact on the machine does not exceed the infrastructure's ability to actually handle it, multithreading does afford the opportunity to do more work in less time ... [only] in properly-designed scenarios.
Last edited by sundialsvcs; 10-18-2016 at 03:42 PM.
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
Linux is a true multithreading OS. Uniprocessor machines of today use processors with multiple cores, each of which can handle threads. On Intel processors (Core i3, i5 and i7) each core can handle (2) threads. With certain programs you can specify the number of cores to use, such as with
Code:
make -j6
will use 6 cores to compile the program.
But multithreading only works if the software can take advantage of it. Programs like word processors, web browsers, and photo editors typically will only use one processor core.
Linux is a true multithreading OS. Uniprocessor machines of today use processors with multiple cores, each of which can handle threads. On Intel processors (Core i3, i5 and i7) each core can handle (2) threads. With certain programs you can specify the number of cores to use, such as with
Code:
make -j6
will use 6 cores to compile the program.
But multithreading only works if the software can take advantage of it. Programs like word processors, web browsers, and photo editors typically will only use one processor core.
I would just correct 1 thing. Desktop i5's are non hyperthreaded and only do 1 thread/core (as they're quad core vs. the hyperthreaded dual core i3's and quad core hyperthreaded i7's), as well as mobile core-i5 H-series chips (which are also quad core), although mobile U-series chips are all hyperthreaded.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.