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 7166471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:25:09+00:00 2026-05-28T14:25:09+00:00

I am confused about the applicability of multi threading in general… I am creating

  • 0

I am confused about the applicability of multi threading in general…

I am creating an application which executes some code which has been saved in xml format. The work is to use apache http client and retrieve some data from websites…More than 1 website can be visited by one block of code in xml…

Now I want that if 2 users have created their own respective codes and saved them in XML, then each user’s ‘job’ (ie block of code in xml format) runs in a separate thread.

I have with me code to execute one user’s code…Now I want that multiple persons’ code can be run in parallel. But I have some doubts–

(1) The Apache HTTP client provides a way of multithreaded communication, currently I am simply using the default HTTP client- this same client can be made to visit multiple websites, one after the other- as per code block in xml. Am I correct in thinking that I do not need to change my code so that it uses the recommended multithreaded communication?

(2) I am thinking of creating a servlet that when invoked, executes one block of xml code. So to execute 2 blocks of code as given by 2 different users, I will have to invoke this servlet twice. I am going to deploy this application using Amazon Elastic Beanstalk, so what I am confused about is, do I need to use multi threading at all in my program? Can I not simply invoke the existing code (which is used to execute one block of code at a time) from the servlet? And I do want to keep processing of the different blocks of XML code separate from each other, so I dont think I should use multi threading here.. Am I correct in my assumption?

  • 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-05-28T14:25:10+00:00Added an answer on May 28, 2026 at 2:25 pm

    Running it one after the other as per your 1st option will not be considered ‘concurrent’ .

    Coming to the servlet method , the way you describe it will work concurrently , but you also need to think about how many users concurrently ? Since for each user , there would be a separate request , there would be some network latency involved for multiple calls. You need to think about all these factors before going ahead with this option

    Since you have the code for one user’s job , you can define a thread class which has userid as an attribute. In the run() method call the code for a particular user’s job.

    Now create two threads and set the appropriate userid for each thread and spawn them off.

    If the number of users are more , you can look at using Java’s Thread Pool Executor .

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

Sidebar

Related Questions

I am bit confused about ADO.Net Data Services. Is it just meant for creating
I've always been confused about how the linker works, and it's a difficult subject
I'm a bit confused about the right way to write a code. I read
I'm a little confused about the MVVM pattern which i'm combining with PRISM. In
I've always been confused about this one. Consider the following loops: int [] list
I'm a bit confused about the difference between a facebook canvas application and a
Very confused about this one. This code in views.py works, but only when I'm
been confused about this for over two hours, so maybe someone can point me
I'm confused about Content and Remove items in a List. Can someone teachme some
Confused about if condition, how does it executes following statements. if(1 && (1 ||

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.