|
| |||||||||
| Tags: language, process, programming, thread |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Thread vs Process
Hello, I am student of the BSC.I.T. and I want to know the difference between the Thread and Process. I have try to check the details about it, but I am not able to get the details of it. So, if anyone from you knows what is the difference between them then please help me to get that. |
|
#2
| ||||
| ||||
| Re: Thread vs Process
Hello, if you are talking about the process then it is a collection of the virtual memory space, your code, all of your data and all of the resources which you use. And a thread is a code that is gets executed in serial manner within that process. So, if you consider the thread then it is executed by the processor. So, each and every application contains one process minimum. But, your single process can have multiple threads. |
|
#3
| ||||
| ||||
| Re: Thread vs Process
If you are using java programming language then your thread implementation can be performed as below: First you will define a class which contains that thread as below: Code: class Testing extends Thread
|
|
#4
| ||||
| ||||
| Re: Thread vs Process
Hey, you need to consider the points given below for getting the difference between the Thread and Process: Threads :. ● If you are using Thread then it will directly share your memory. ● It will also share you file descriptors. ● It have the capability to share your filesystem context. ● You are able to share signal handling. Processes: ● It won't share your memory by default. ● In case of the processes it is not possible to share file descriptors. ● You are not able to share the filesystem context. ● Don't share signal handling. |
|
#5
| |||
| |||
| Re: Thread vs Process
Hello, for creating a thread or process you need to make use of the following syntax: Creating a thread: Code: clone(c_stack=1x230cc540, flags=CLONE_TA|CLONE_FT| CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM| CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=1x230cc3e4, tls=1x230cc562, child_tidptr=1x230cc3e4) Code: clone(c_stack=0, flags=CLONE_CHILD_CLEARTID| CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f4936ecc770) |
|
#6
| ||||
| ||||
| Re: Thread vs Process
Hey, if you are making use of the thread in your process then it will simply share a single address space and also able to access one another variable. But, your processes can be executed on different addresses and it is necessary to inter process the communication for exchanging the information. In other term you can simply call that the process which is Heavyweight is called as a Process and the process which is a Lightweight is called as a Thread. If you make use of the thread than process then it will provide you faster response. And that is why it will be used for the switching between the threads. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Thread vs Process" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Synchronize a producer thread and a consumer thread in C# | Ayuka | Software Development | 6 | 10-11-2010 04:04 AM |
| Differentiation between Process and thread | opaper | Software Development | 5 | 29-01-2010 08:51 AM |
| How to terminate Process and Delete the Source Program with Ultimate Process Killer | jackalz | Tips & Tweaks | 1 | 26-03-2009 07:31 PM |
| STOP:C000021a Process System Process Terminated Unexpectedly | Robert J. Rando | Windows XP Support | 5 | 26-12-2005 06:26 AM |