The Mutex (Mutually-exclusive-access flag) is used to achieve mutual exclusion between different virtual users in the LoadRunner script
Why the name VTS_MUTEX is because, this Mutex is one VTS cell data
History:
The reason behind the usage of Mutex is to achieve mutual exclusion between the virtual users
Suppose there are n virtual users for the same script (Because they use same parameter file), and needed to do a task on a single resource .This task is to be done as if one vuser is doing the task, no other vuser should perform that task irrespective of load generator on which this vuser is operating on
Description:
Now we have a script where this mutual exclusion to be implemented
This needed a Parameter file called MUTEX_PARAMETER_FILE
And one column of VTS should be dedicated for this mutual exclusion. Let us name it as MUTEX_VTS_COLUMN
Every vuser must take UNIQUE data from the table as ONCE
In the VTS column the 1*1 cell is the MUTEX variable
Now with the things are ready , we can now distribute the load
The logic of the implementation of Mutual exclusion will make the vusers having their data value from the parameter table will wait until the 1*1 cell data will have the same value
The vuser having the value from parameter table equals to the 1*1 value will enter into mutual exclusion area of the code and do the work and when he comes out of that mutually exclusive area, he will move the column values of the VTS one row up
/*
-------------------------------------
this is for getting the column size
-------------------------------------
*/
vtc_column_size (ppp, "login", &size);
/*
--------------------------------------
this is to get 2nd element of the col1
--------------------------------------
*/
/*
------------------------------------------------------
this is for copying from 3 to end of col1 to an array
------------------------------------------------------
*/
for( i=3;i<=size;i++) { if ((rc = vtc_query_column(ppp, "login", i, &vts_col_array[i-3])) != 0) { lr_output_message("******************** VTS Error - Query Return Code = %d", rc); } } /* -------------------------------------------------------- this is for updating from 2 to end of col1 by moving up -------------------------------------------------------- */ for( i=0;i
No comments:
Post a Comment