Results 1 to 6 of 6

Thread: Thread vs Process

  1. #1
    Join Date
    Nov 2009
    Posts
    117

    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. #2
    Join Date
    Feb 2008
    Posts
    1,852

    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. #3
    Join Date
    May 2008
    Posts
    2,389

    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
    • When the parent thread creates object and it gets executed by the use of the function as name of the start().
    • It will simply create a child thread and then it will call the run() function.
    • And the termination of the thread will be done when you will make use of the stop() function.

  4. #4
    Join Date
    Jan 2008
    Posts
    1,521

    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. #5
    Join Date
    May 2008
    Posts
    2,012

    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)
    Creating a process:
    Code:
    clone(c_stack=0, flags=CLONE_CHILD_CLEARTID|
    CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f4936ecc770)

  6. #6
    Join Date
    Apr 2008
    Posts
    1,948

    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.

Similar Threads

  1. Replies: 6
    Last Post: 01-03-2012, 08:51 PM
  2. Replies: 7
    Last Post: 29-02-2012, 10:19 PM
  3. Replies: 3
    Last Post: 28-02-2012, 08:35 PM
  4. Synchronize a producer thread and a consumer thread in C#
    By Ayuka in forum Software Development
    Replies: 6
    Last Post: 10-11-2010, 04:04 AM
  5. Differentiation between Process and thread
    By opaper in forum Software Development
    Replies: 5
    Last Post: 29-01-2010, 08:51 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,045,041.43492 seconds with 16 queries