Run java code in multiple jvm instances

前端 未结 2 590
日久生厌
日久生厌 2021-02-10 16:25

I have a windows service application and a client which communicates with service using RMI. I need to do some concurrency testing with multiple clients but I need every client

2条回答
  •  孤街浪徒
    2021-02-10 17:09

    You could use a shell script to spawn a new client with its own set of parameters in a loop.

    But, in general. Running client code in several VMs just because there are some static variables being shared is definitely not a good solution. The fundamental problem is in your client code, as already suggested, you could use ThreadLocal, ThreadPools, or some synchronization logic to isolate a set of variables between various client threads.

提交回复
热议问题