answersLogoWhite

0


Best Answer

A process is an instance of a computer program. Each process has its own address space and executes concurrently with other processes. If the system has multiple CPU cores, two or more processes may execute simultaneously.

Every process has at least one thread of execution, the main thread. Any thread within a process can instantiate a new thread of execution within that same process. Every thread shares the same address space as the process itself, however each thread has its own local stack. This makes it possible for two threads to call the same function concurrently. If the system has multiple CPU cores, two or more threads within the same processes may execute simultaneously.

Programmers use multiple thread to divide complex tasks into simpler tasks that can be executed concurrently. As a simple example, suppose we must search an unsorted array of 1 million elements. We could use a single thread and search the entire array from beginning to end but there's a 50/50 chance the element we are looking for resides in the second half of the array which means that we'd need to search through 500,000 elements on average. By dividing the array between two worker threads we should get a result twice as quickly because each thread now only searches an average of 250,000 elements. It therefore follows that the more threads we utilise, the quicker we should get a result, but that's only true up to a point because the number of threads we can physically execute simultaneously depends on the number of CPU cores available. If all threads execute upon the same core then there is no point in multi-threading this particular task. Nevertheless, the task is likely to take some time to complete so it would still be beneficial to delegate the task to at least one worker thread.

For example, if the main thread manages a message queue, the worker thread can post messages to the queue to keep the main thread abreast of its progress. Meanwhile, the user can continue to interact with the process, posting messages to the queue to perhaps initiate another search (in another thread). In this way the main thread's task is reduced to nothing more than processing messages and delegating tasks to worker threads. This is clearly an over-simplification, however it's this type of multi-threading that makes it possible for a graphical user interface to remain responsive to user interactions while time-consuming tasks are being carried out in the background by worker threads.

User Avatar

Wiki User

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

Wiki User

15y ago

A process is a single program that is running in memory, which is assigned its own address space. Multiple processes can not share memory, and attempts to access memory outside of what is assigned to your process will give you a segmentation fault.

A thread is capable of sharing address space with other threads, so for example, you could have a single process that creates a queue and spawns two threads, one that produces into to the queue and another that consumes from the queue. These two threads run separately but share the same memory space.

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

Every process has at least one thread, the main thread. However threads can spawn new threads. Every thread in a process shares the same virtual memory space but has its own stack. Threads allow a process to perform concurrent tasks.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

operating thread is nothing but a simple programs or some information is provided in a row where process threads are the which a single sequence stream within a process

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is difference in operating threads or process threads?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the difference between processes and threads?

The memory space, where a given application is executed is called - process. A Process is the memory set aside for an application to be executed in. Within this process the thing, which is really executed is the thread. The key difference is that processes are fully isolated from each other; threads share (heap) memory with other threads running in the same application. Threads share the address space of the process that created it; processes have their own address. Threads have direct access to the data segment of its process; processes have their own copy of the data segment of the parent process. Threads can directly communicate with other threads of its process; processes must use inter-process communication to communicate with sibling processes. Threads have almost no overhead; processes have considerable overhead. New threads are easily created; new processes require duplication of the parent process. Threads can exercise considerable control over threads of the same process; processes can only exercise control over child processes. A great answer to the question can also be found here: (link moved to link section)


Is thread same as a function?

No. A process is composed of one or more threads. Threads can invoke any function of the process.


Explain about threads in computer networks?

A thread is the sequence of instructions followed by a CPU, and is an independently dispachable unit in the run queue. A process can start and manage multiple threads, each managing an aspect of the overall processing. The operating system can schedule the threads independently, allowing them CPU time if they are ready, or blocking them if they are waiting on something, such as an IO completion. In a network process, such as a web server, there can be many things going on at the same concurrent time. Threads are an ideal solution to the problem of managing all of these things, because the main process does not need to poll each sub-process (thread) to see if it needs or is ready to do work.


Threads belonging to the same process share the?

Threads belonging to the same process share the same resources and address space.


Whats the difference between plumbing pipe threads and conduit pipe threads?

Plumbing pipe threads are squared and conduit pipe threads are tapered.

Related questions

Difference between child process and threads in operating systems?

One difference is that, when the main program terminates, all its threads are terminated. It is not the case for processes, because they are kind independent of the parent. When the parent terminates, the process keeps going unless the parent waits for it to die.


What resources are shared by all threads of a process?

The resources that are shared by all threads of a process in Operating SystemsareMain memoryInput Output DevicesInput Output ChannelsFiles


How do threads work in an operating system?

threads are the light weight process or it is a part of the process which can execute simulteniously by sharing systm resources.... two types of thread 1.user level thread 2.kernel level thread


What is the difference between a computer process and thread in microprocessor?

A thread is a sub process in other words one process can contain multiple threads.


What is the difference between concurrent and parallel threads?

Its really so easy to distinguish between the concurrent & parallel threads that A parallel thread is the thread maintained the parallel processing system including the process sheduling system is quite murcible. Where as the concurrent threading is the way of manupulation of a thread using simultaneous process threading. It would be be quite better if the book named "Galvin & Siberscartz" book of "Operating System" the chapter process & threads would be followed for maximum details.


What is the difference between processes and threads?

The memory space, where a given application is executed is called - process. A Process is the memory set aside for an application to be executed in. Within this process the thing, which is really executed is the thread. The key difference is that processes are fully isolated from each other; threads share (heap) memory with other threads running in the same application. Threads share the address space of the process that created it; processes have their own address. Threads have direct access to the data segment of its process; processes have their own copy of the data segment of the parent process. Threads can directly communicate with other threads of its process; processes must use inter-process communication to communicate with sibling processes. Threads have almost no overhead; processes have considerable overhead. New threads are easily created; new processes require duplication of the parent process. Threads can exercise considerable control over threads of the same process; processes can only exercise control over child processes. A great answer to the question can also be found here: (link moved to link section)


What is the difference between process and thread?

Basically no difference, except that process can use many threads; thread can use only one.


How an operating system use time slicing?

It uses time slicing by allocating time to threads for each process/task that is to be executed.


What are the advantages and disadvantages of user level threads and kernel level threads?

- USER LEVEL THREADS Aadvantages: · User-level threads can be implemented on operating system that does not support threads. · Implementing user-level threads does not require modification of operating system where everything is managed by the thread library · Simple representation which the thread is represented by a the thread ID, program counter, register, stack , all stored in user process address space · Simple management where creating new threads, switching threads and synchronization between threads can be done without intervention of the kernel · Fast and efficient where switching thread is much more inexpensive compared to a system call - Disadvantages: · There is a lack of coordination between threads and operating system kernel. A process gets one time slice no matter it has 1 thread or 10000 threads within it. It is up to the thread itself to give up the control to other threads · If one thread made a blocking system call, the entire process can be blocked in the kernel, even if other threads in the same process are in the ready state KERNEL LEVEL THREAD: - Advantages: · Because kernel has the full knowledge of all the threads, scheduler may decide to allocate more time to a process having large number of threads than process having small number of thread, where the kernel threads come useful for intense application - Disadvantages: · Kernel level threads are slow and inefficient, since kernel must manage and schedule all the threads as well as the processes. It requires a full TCB for each thread to maintain information about threads, which results in increasing of overheads and kernel complexity


What is the difference between a process and thread?

The same metaphor: the difference of a person (thread) and a family (process) A process has at least 1 thread and may have many threads, while 1 thread must live within a process


Explain about threads in computer networks?

A thread is the sequence of instructions followed by a CPU, and is an independently dispachable unit in the run queue. A process can start and manage multiple threads, each managing an aspect of the overall processing. The operating system can schedule the threads independently, allowing them CPU time if they are ready, or blocking them if they are waiting on something, such as an IO completion. In a network process, such as a web server, there can be many things going on at the same concurrent time. Threads are an ideal solution to the problem of managing all of these things, because the main process does not need to poll each sub-process (thread) to see if it needs or is ready to do work.


Is thread same as a function?

No. A process is composed of one or more threads. Threads can invoke any function of the process.