answersLogoWhite

0


Best Answer

Overview A thread is a path of execution through a program. Single threaded programs have one path of execution, and multi-threaded programs have two or more paths of execution. Single threaded programs can perform only one task at a time, and have to finish each task in sequence before they can start another. For most programs, one thread of execution is all you need, but sometimes it makes sense to use multiple threads in a program to accomplish multiple simultaneous tasks. Threads the scienceA thread in computer science is short for a thread of execution. Threads are a way for a program to fork (or split) itself into two or more simultaneously (or pseudo-simultaneously) running tasks. Multiple threads can be executed in parallel across many computer systems. This is multithreading, and generally occurs by time slicing (similar to time-division multiplexing) across the computer systems. However, in a single processor environment, the processor 'context switches' between different threads. In this case, the processing is not literally simultaneous, for the single processor is really doing only one thing at a time. This switching can happen so fast as to give the illusion of simultaneity to an end user. For instance, many PCs may only contain one processor core, but one can run multiple programs at once, such as typing in a document editor while listening to music in an audio playback program. Although the user experiences these things as simultaneous, in truth, the processor quickly switches back and forth between these separate processes. On a multiprocessor or multi-core system, now coming into general use, threading can be achieved via multiprocessing, where different threads and processes can run literally simultaneously on different processors or cores. Threads exist within a process - every process has at least one thread, the 'main' thread. Threads share the process's resources, including memory and open files. This makes for efficient, but potentially problematic, communication. Why use multiple threads in applications? Historically, code written is sequential, which means, code is executed one instruction after the next in a monolithic fashion, with no regard to the many possible resources available to the program. Overall performance can be serverely degraded if the program performs a blocking call.

Why is it that many programs are sequential? One guess is that most of us think in a sequential manner. Parallelizing our thoughts does not come naturally nor is it an easy task. However, with the increasing availability of Symmetric-Multiprocessing machines, and even more advanced multi-core processors; programming multithreaded code is a skill worth learning. Threads can add substantial performance improvements to certain types of applications, even on single processor systems. Applications that require accessing data from multiple sources, performing different types of manipulation on data and/or transfering data to multiple end-points are all potential for threaded applications. Basically, anytime a program sequence may be stopped waiting; that sequence is a good candidate for creating a thread. A program sequence may be stopped waiting for data from a hardware device, waiting for user input or waiting for a specific state or condition to be met. NexusWare Core has enabled developers to develop and successfully deploy applications such as Lawful interception applications, Class 5 Soft-switch applications, SS7 line monitoring, SS7 STP, Suite of GSM mobile applications - SS7 Link replacement, Roaming Broker, Protocol converters, Radar data processing, defense applications and many more. These types of applications are complex and require access and manipulation of data from many different data sources. Creating multiple threads within these applications has shown dramatic performance gains. Multi-threading are a good fit for the types of applications that are performed on NexusWare target hardware.

User Avatar

Wiki User

16y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Single threaded Process and Multi-threaded Process?
Write your answer...
Submit
Still have questions?
magnify glass
imp
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.


What components of program state are shared across threads in a multithreaded process?

Obviously Heap Memory


What is multithreaded operating system?

lMultithreading an interactive application may allow a program to continue running even if part of it is blocked. For instance, a multithreaded web browser could still allow user interaction in one thread while an image was being loaded in another thread.


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 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.


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


What mean by multithreaded program?

A multithreaded program is one that has multiple threads in execution. They may execute parallel to one another or totally without relation to one another. In Java you can create multithreaded programs using Java threads.


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 the Difference between a single threaded file server and a multi-threaded file server?

Single thread means that the processor will wait until one 'process' is complete before it opens a new thread or 'process'. Multi-thread can handle multiple threads simultaneously making it faster and more responsive.