Hi Aswathy,
We achieved this (multi-threading cucumber-JVM sitting on Geb) by using the GPars library. BUT:
(1) the threads were too heavy. Each of our JVM instances is 750M in size and the threads barely improved on the performance of single-threading. I'm inclined to think there were just too many cache misses, and any gains from multi-threading were lost.
(2) Cucumber is still not thread-safe (am I right? I'm writing nearly a year on from our multi-threading tech spike) so there is some risk that you'll get strange bugs creeping in. In practice I didn't notice this happening when I ran our tests in 2 threads. If you're saving values between steps you will need to make sure they're saved in a thread-safe way (e.g. store them in a ConcurrentHashMap) but that still doesn't guarantee thread-safety if the Cucumber application is still not thread-safe.
(3) the more concurrent threads there are, the worse problems (1) and (2) get, so multi-threading will not scale well.
So my advice is to give up on multi-threading :(
We too need better performance for our Cucumber tests, so we may have a go at running tests concurrently on n AWS instances, served by a work queue (e.g. Amazon SQS.) That should scale well, and none of the thread-safe problems.
Cheers,
Nick