What Is Meant By Thread? What Are The Different Types Of Threads?

7

7 Answers

Azhar Mehmood Profile
Azhar Mehmood answered
Thread: In computer programming, part or section of a program that can execute independently and not dependent on other processes or program for its execution in know as "Thread". A thread is not aware about the other programs that might be running on the computer simultaneously with it. In-short we may say that a thread is not aware what's happening everywhere else in the computer.    There is no event loop associated with a thread. A computer system may or may not support multi-threading (more than one threads running simultaneously) as multi-threading is a feature of operating system. DOS (disk operating system) doesn't support multi-threading while Microsoft Windows and Linux supports multi-threading.  If operating system doesn't support multi-threading, then a computationally intensive (that requires more CPU cycles) program or application will held CPU, i.e. An infinite loop may help CPU.  On the other hand if the operating system supports multi-threading then the tasks not defined in an infinite loop don't wait for a stuck task (like infinite loop) to end.    There are two types of threads;  (a). User threads.  (b). System threads.  (a). User thread: A thread that is created by the user application.  (b). System thread: It's a thread that is created by the operating system to execute or serve user.
Muhammad Azhar Profile
Muhammad Azhar answered
A thread is a basic unit of CPU utilization. It is also called a lightweight process. A thread is a sequence of instructions within a process. A thread behaves like "a process within a process" but it differs, from a process in that a thread does, not have its own PCB. Usually multiple threads are created within a process Threads are different kind of program executing within process. Processes are programs in execution within kernel.
Thread consists of the following:

• Thread ID
• Program Counter
• Register Set
• Stack
A thread shares some things with its peer threads (all the other threads in this particular task). The things that it shares are:
• Code Section
• Data Section
• Any operating system resources, which are available to the task.

A traditional heavyweight process is the same as a task with one thread. The term thread really refers to thread of execution. A multi-threaded process means that-more than one part of the same process may be running at one time.

In a multi-threaded task, one server thread may be blocked and waiting for something and another thread in the same task may be running. If a heavyweight process blocks then the whole process stops. Multithreading is useful in programs such as web browsers where you may wish to download a file, view an animation and print something at the same time.
When multiple threads cooperate in a single job, there is a higher throughput. If one thread must wait, the whole process does not stop. Another thread may still run. Applications that require sharing a common buffer (such as the producer consumer problem) may benefit from using threads.

Threads may be handled at different levels.
Kernel-Level Threads:
Kernel-supported threads are seen by the operating system and must be scheduled by the operating system. One multithreaded process may have multiple kernel threads.
User-Level Threads:
User-level threads are not seen by the operating system and are also very fast. Switching from one thread to another in a single process does not require a context switch since the same process is still executing. However, if the thread that is currently executing blocks, the rest of the process may also be blocked if the operating system sees only one kernel thread for this process. The thread that the kernel sees is the same as the blocked thread, hence the kernel assumes that the whole process is blocked.
Anonymous Profile
Anonymous answered
Mainly there are two types of thread.These are 1.Right hand thread  2.Left hand thread
Anonymous Profile
Anonymous answered
Thread is a smallest unit of cpu utilization.
There are 2 types of threads user space & kernel space
Muhammad Ali Profile
Muhammad Ali answered
You've asked question about thread. You want to know what the meaning of thread is and how many kinds of threads are there? Now to know its meaning, we need to look for its basic units. Then we can understand what is meant by a thread.

A thread can be defined as a fine unit of cord of a fibrous material, such as cotton or flax, made by 2 or more filaments twisted together. And that is used in weaving cloths and in different kind of needlework.

So if you'll think about the above description. A picture will appear in your mind. That will tell you what is meant by thread. And now you can recognize the threads easily by keeping these points in your mind. Now you've asked the different kinds of threads. I think, as soon as you came to know the definition of thread, you can understand its kinds. But let me tell you some of its kinds. A thread can be of following kinds.

A thread of fiber, thread of cotton, thread of yarn, string, wire, yarn and many more. I think now you can understand it adequately. And now you're satisfied.

Answer Question

Anonymous