featured

What is the difference between a process and a thread?

process-vs-threadProcess is defined as the virtual address space and the control information necessary for the execution of a program while Threads are a way for a program to split itself into two or more simultaneously running tasks. In general, a thread is contained inside a process and different threads in the same process share some resources while different processes do not.

Source

In terms of Loadrunner, when we run Vuser as a process, LoadRunner creates 1 process called mmdrv.exe per Vuser. So if we have 10 Vusers, we will have 10 mmdrv.exe processes on our machines.

while when we run Vuser as a thread, LoadRunner creates 1 thread per Vuser. So if we have 10 Vusers, then we will have 1 process with 10 threads running inside it if the limit is 10 threads per process.

Running Vuser as a thread is more memory efficient that running Vuser as a process for obvious reasons that less memory resources are utilized when we run them as thread. I read somewhere that running as a process has an advantage that system becomes more stable. Now how is that stability achieved? I am not sure…can someone clarify this point to me?

Note that while running Java Virtual User, JVM’s are loaded per process and will follow the same principle above.

Related: What is RAM, Memory Usage, CPU Usage, Paging in terms of LoadRunner?

Related posts:

  1. Difference between concurrent and simultaneous vuser
  2. How to calculate memory requirement for Vusers

Discussion

8 Responses to “What is the difference between a process and a thread?”

  1. Just wanted to say hello all. This is my first post.

    I would like to learn alot here.

    Posted by Hydrolyze | October 16, 2009, 6:55 am
  2. The decision whether to run Vusers as separate processes rather than threads in a process is connected with the concept of thread safety. When a multi-threaded application (in our case the Vuser script) is executed, all threads execute simultaneously in a shared address space and each thread has access to nearly all the memory of every other thread. Thus, when a large number of Vusers is run, side effects can appear if non thread-safe procedures are used in the Vuser code. In this case Vusers have to be run as separate processes.

    Further information regarding the Vuser thread safety can be found in the LoadRunner documentation. I myself have seen functions in the Function Reference that are explicitly marked as not thread-safe under certain circumstances. For example, under Unix, strftime is not thread-safe.

    Posted by Ivo Plamenov | November 4, 2009, 3:57 pm
  3. I found this discussion while figuring out what “mmdrv” is because I came in this morning to find an error message from this process – I had left a long-running VuGen overnight.

    Just to answer the above question about why a process might be better for system stability than a thread – which was hinted at in the previous reply – a mal-functioning thread can freeze or take down the entire process, along with any other threads in it, whereas a mal-functioning process only hurts itself.

    Thanks for the insight into LoadRunner.

    Posted by Devon McCormick | September 23, 2010, 6:11 pm
  4. hey what s actually difference between magentproc.exe and magentservice.exe
    can u pls explain?? i am beginner in load runner

    Posted by yogaraj | March 4, 2011, 7:21 pm
  5. Hi,
    “why a process might be better for system stability than a thread?”
    During the load/performance testing Vusers are the virtual users that might use the system at certain pace at certain interval. And Comming to actual scenario actual user actions would work as a process on the system under test. So to simulate more closely to actual environment and take the system to better stability issues it is always better to use Vuser as process.
    Regards,

    Posted by Neeraj | May 11, 2011, 3:26 pm
  6. Nice Topic.Really enjoyable

    Posted by Alamgir | July 14, 2011, 12:27 pm
  7. An executing instance of a program is called a process.
    Some operating systems use the term ‘task‘ to refer to a program that is being executed.
    A process is always stored in the main memory also termed as the primary memory or random access memory.

    A thread is a subset of the process.
    It is termed as a ‘lightweight process’, since it is similar to a real process but executes within the context of a process and shares the same resources allotted to the process by the kernel (See kquest.co.cc/2010/03/operating-system for more info on the term ‘kernel’).
    Usually, a process has only one thread of control – one set of machine instructions executing at a time.

    Posted by sagar | July 14, 2011, 12:32 pm
  8. great work

    Posted by sivakrishna | November 10, 2011, 3:11 pm

Post a comment

Archives

Grab My Banner

Learn LoadRunner
buy clomid | online pharmacy | buy prozac | your doctors prescription | buy accutane | prescription medication | buy lipitor | trusted online pharmacy | buy bactrim | cheapest medication | buy prednisone | where can i buy my medication | buy actos