| || |
Wait Function Vu
User (email@example.com) posted:
I wanted to run a vu script with "n" users in a such a way that only one
user would be able to execute the code at a given time.
I landed upon the "WAIT" function, but get a parse error and am not able
to compile it without an error
THE FUNCTION USED LOOKS LIKE AS FROM VU HELP MANUAL
This example allows only one user to access a critical section of code.
The wait routine blocks until inuse equals 0 (the initial value for all
shared variables), and upon obtaining access, uses an adj value of 1 to
lock out all other virtual testers. Upon completion of the critical
section, inuse is reset to zero to allow access to other virtual testers
(who are executing identical code segments). Recall that if virtual
testers are blocked concurrently, access is granted on a first-come,
wait(&inuse, 0, 0, 1);
/* critical section of code */
inuse = 0;
COULD SOME ONE KINDLY HELP ME RESOLVE THIS ERROR WITH AN EXPLAINATION AND
SAMPLE SCRIPT TO ELUCIDATE.
THANKING ONE AND ALL IN ANTICIPATION