Hello all,
I have questions regarding the multi thread processing using Ant fork approach
Below are the Jar files and associated java classes and methods
Test1.jar has
--Test1.java has
--MethodA()
Test2.jar has
--Test2.java has
--MethodB()
Test3.jar has
--Test3.java has
--MethodC()
runtime.classpath will have: Test1.jar,Test2.jar and Test3.jar
testsuite.list: Test1.tsv,Test2.tsv,Test3.tsv
Test1.tsv
-- calls MethodC(), MethodB(), MethodA() in sequence
Test2.tsv
-- calls MethodA(), MethodB(), MethodA()in sequence
Test3.tsv
-- calls MethodB(), MethodA(), MethodA()in sequence
Ant sciprt:
When Ant scripts triggered
Thread 1 pickup Test1.tsv
Thread 2 pickup Test2.tsv
Thread 3 pickup Test3.tsv
Now my question is when 3 threads executing in parallel 3 instances of each Test1.java, Test2.java and Test3.java created ? Or there will be only one instance of Test1.java, Test2.java and Test3.java?
If only once instance of Test1.java, Test2.java and Test3.java created while Thread1 exeucting MethodA() , Thread2 has to wait until Thread1 completes MethodA() execution?
Can some help me to understand this. Also, is there a way I can know how many threads executing given method at a time , is there any locking happening or how many java instances created?
Other point to note is my MethodA(),MethodB(),MethodC() has implementations that’s has wait time and retry mechanism to look for web elements. So I am not sure when multiple threads executing what’s happening .. Sometime I am seeing lot of delay to complete method execution so wondering if there is any locking happening.