answersLogoWhite

0


Best Answer

Not having multithreading is like only having one arm and one gram of brain tissue. Multithreading is essential to computer application operation.

Multithreading allows a computer to:

* Distribute processing power over various applications, allowing multiple programs to run at the same time. * Allow a program to run non-essential processes in the background while the main application continues to run normally without hold-ups. * Manage timing of different events without making the process too complicated. For example, say that you have an application that does text editing and plays music. You would want to run the text editor part and the music playing part on separate threads, because otherwise, when the text editor got to a computation-intensive stage, the music would be slower, and when the text editor was idle, the music would be faster.

This is also what allows the computer to run multiple applications at once. If the computer could not distribute processing power over multiple applications, then you could not run multiple instances of a text editor, or an internet browser, or really anything. Really, nothing would be possible because the system resources would monopolize the processor.

In reality, this is how the processor handles threads: it goes around and devotes some time to each one, then moves on to the next. It "rounds the bases" so fast, like a cathode ray tube TV, that we don't notice the different. Duel (and triple, and quad, etc.) core processors allow one to split the applications and their corresponding threads to operate on different processors, affecting how much processing power they each receive.

User Avatar

Wiki User

16y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

Multithreaded programming is beneficial over single threaded programming because it simplifies the code, allowing each thread to concentrate on one task, and it allows you to take advantage of a multiprocessor/multicore system. You can also write one copy of code and spawn multiple instances of a thread to handle identical processing needs. This is often done in servers, so that a hang in one thread will not impact the processing of another thread.

It is more complex, however, in that you must pay attention to concurrency issues but, all things considered, it is the way to go in the long run.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why multithreaded programming is beneficial over single threaded programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the difference between single threaded and multithreaded in java?

A single threaded application is one that has only one thread of execution running at any given point of time. Whereas a multi-threaded application can have multiple threads of executing running simultaneously. Generally in enterprise applications, we need to fetch and load a lot of data before the system starts or initializes. In such cases, we typically spawn multiple threads and let the load operations run in parallel to save time. Lets say you need to fetch 10 different sets of data each of which will run for approximately 1 minute, if you run them all in sequence one by one, your system will load only after 10 minutes. But, if you spawn 10 threads, the system might load in around 2 minutes which is much faster than the single threaded time.


What is single thread of screw thread?

when lead of the screw is equal to the pitch it is called single threaded screw


Two threads are waiting for keyboard input one in each process Does this problem ever occur in single threaded processes?

Single-threaded processes only have one thread of execution -- therefore it would not be possible to have two processes waiting for input at the same time.


What is a single word synonym for serving a useful purpose?

Beneficial


Why are double quotes used in C programming?

In C programming, double quotes are used to indicate String literal. char *s = "Hello World"; Where as single quotes are used to indicate a single character. char x = 'a';

Related questions

What is the difference between single threaded and multi threaded process?

A write-up of the answer to this question can be found here:http://msdn.microsoft.com/en-us/library/ms693344(VS.85).aspx"There are two types of apartments: single-threaded apartments, and multithreaded apartments. * Single-threaded Apartments-Single-threaded apartments consist of exactly one thread, so all COM objects that live in a single-threaded apartment can receive method calls only from the one thread that belongs to that apartment. All method calls to a COM object in a single-threaded apartment are synchronized with the windows message queue for the single-threaded apartment's thread. A process with a single thread of execution is simply a special case of this model.* Multithreaded Apartments-Multithreaded apartments consist of one or more threads, so all COM objects that live in an multithreaded apartment can receive method calls directly from any of the threads that belong to the multithreaded apartment. Threads in a multithreaded apartment use a model called free-threading. Calls to COM objects in a multithreaded apartment are synchronized by the objects themselves."


What is the difference between single threaded and multithreaded in java?

A single threaded application is one that has only one thread of execution running at any given point of time. Whereas a multi-threaded application can have multiple threads of executing running simultaneously. Generally in enterprise applications, we need to fetch and load a lot of data before the system starts or initializes. In such cases, we typically spawn multiple threads and let the load operations run in parallel to save time. Lets say you need to fetch 10 different sets of data each of which will run for approximately 1 minute, if you run them all in sequence one by one, your system will load only after 10 minutes. But, if you spawn 10 threads, the system might load in around 2 minutes which is much faster than the single threaded time.


How do you calculate the number of turns in a threaded screw?

Divide the threaded length by the lead length. For single threaded screws the lead is the same as the pitch.


What is nymhy cable?

NYMHY : Multi Threaded flexible wireSee also:NYA : Single threaded hard wire 750/450 Volts NYAB : Single threaded hard wire 750/450 VoltsNYAF : Single threaded hard wire 500/300 VoltsNYY : Multi threaded flexible underwater wire with water repelant cover gel (cable washing is needed for connections) 1000/600 Volts


Single program Uni-programming?

A single program is also known as uni programming. Uni programming only allows on program to be present in the memory at a time. Single program


What is single thread of screw thread?

when lead of the screw is equal to the pitch it is called single threaded screw


Which interface must you implement to ensure that your Servlet is single threaded?

SingleThreadModel


What is difference between single threaded servlet and multi threaded servlet?

The single thread model means that your servlet would not be multi-threaded. If there are two concurrent requests to your servlet then 2 instances of your servlet will be created to process these 2 requests. You can implement the single thread model by implementing the SingleThreadModel interface in your class. This is just a marker interface and does not have any methods. The multi threaded model means that your servlet would be multi-threaded and only one instance would exist. Multiple concurrent requests would be served by the same instance but in different threads. You can implement the multi threaded model by not implementing the SingleThreadModel interface in your servlet class.


What is thread in processors?

The core count is the physical number of cores on the CPU die itself, whereas the thread count is the number of individual application threads which can be executing simultaneously on the CPU itself. Without any additional or special hardware, this is always equal to the core count.Some Intel CPUs have a feature called hyperthreading, which allows an operating system to see double the amount of logical cores per physical core. This allows the operating system to schedule and run double the amount of threads simultaneously, so in the case of the CPU I linked to above, there are four physical cores, but eight logical ones (so you can run eight threads simultaneously).Each individual application running in the operating system is either single-threaded or multi-threaded (think of each thread as a "sub-application"). Single threaded applications require just one thread to run on the CPU, whereas multi-threaded applications have many sub-threads running simultaneously. Additional cores, or hyper-threading, allows more application threads to simultaneously run at once.This allows multi-threaded (not single threaded) applications to run much faster, since more then one thread can run at once on the CPU.Just a final note, hyperthreading improves the performance of some multithreaded applications specifically optimized for it (since there are still only half the number of physical cores as there are logical). In some various cases, applications may run faster with hyperthreading disabled (although many applications do benefit from it). Regardless of hyperthreading, an increase in the number of physical cores will always benefit multithreaded applications.


Two threads are waiting for keyboard input one in each process Does this problem ever occur in single threaded processes?

Single-threaded processes only have one thread of execution -- therefore it would not be possible to have two processes waiting for input at the same time.


What is a single word synonym for serving a useful purpose?

Beneficial


What is difference between Stud and stud bolt?

stud has all its length threaded and it is used with two nuts, but the bolt has one end closed and the other end is threaded ,it is used with a single nut.