Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7764233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:51:31+00:00 2026-06-01T14:51:31+00:00

I am trying to stress test a client/server system by emulating multiple clients connecting

  • 0

I am trying to stress test a client/server system by emulating multiple clients connecting to the server. There is a thread per client. BUT, when I run the following code (ClientStartEmulator() represents a client), threads run sequentially rather than concurrently. (despite there being multiple thread yields and sleep within each emulated client). Any ideas what is wrong?

An alternative would be to do a system call to each jar, but this would be annoying as (not shown here), I do some processing on the arrays returned.

Thanks!

ClientStartEmulator emu = new ClientStartEmulator();
    emu.start(7777, "localhost", "examplestore", "foobar", "signFiles", "foobar", true, time, max_length); 
    ArrayList results = new ArrayList() ; 
    for (int i = 0 ; i<nb_clients ; i++ ) {
        Thread client = new Thread() {
            public void run() {
                ClientStartEmulator emul = new ClientStartEmulator();
                try {
                    emul.start(7777, "localhost", "examplestore", "foobar",     "signFiles", "foobar", false, time, max_length);

                } catch (InterruptedException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                } 
            }
        };
        client.run(); 

    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:51:32+00:00Added an answer on June 1, 2026 at 2:51 pm

    You should be calling client.start() which starts the thread in the background. By calling client.run() you are executing the run method in the calling thread instead. Not what you want I assume.

    From the Thread code:

    /**
     * Causes this thread to begin execution; the Java Virtual Machine 
     * calls the <code>run</code> method of this thread. 
     * <p>
     * The result is that two threads are running concurrently: the 
     * current thread (which returns from the call to the 
     * <code>start</code> method) and the other thread (which executes its 
     * <code>run</code> method). 
     * ...
     */
    public synchronized void start() {
       ...
    

    The start() method creates the native thread and returns while the new thread calls the Thread.run() method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a small server using java.nio , but when trying to stress test
I am trying to test a stress test a web service using JMeter but
I am trying to run the stress.py stress test included with Cassandra. When I
I'm trying to build a small stress test script to test how quickly a
I am trying to stress test an ASP.Net MVC application using the WCAT tool.
I am trying to create a basic console app in order to stress test
I'm trying to use Monkey debuggin tool (from adb) to stress test a part
I'm trying to create a scrabble-solver to run stress-tests on a scrabble-like game I'm
I am new to testing so I am trying to test some random things
So I have a test case that I want to make into a thread.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.