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

  • Home
  • SEARCH
  • 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 8936027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:07:17+00:00 2026-06-15T10:07:17+00:00

One of the things a core java server i’m running does is process two

  • 0

One of the things a core java server i’m running does is process two type of tasks (T1 and T2) . Originally these tasks were being processed from the same queue and thread. At times the queue contains about 1000 T1 tasks which cause delays for the next T2 task. So i decided to change the architecture and process each task in a separate thread and separate queue. But it looks like the JVM will still process the ~1000 T1 tasks (about .6 seconds) before switching to the other thread and processing T2 tasks.

I’m running on a quad core machine running “Red Hat Enterprise Linux Server release 6.1 (Santiago)”.

I’m assuming that the two threads are being run on the same CPU.

Is there any way to facilitate the OS or JVM to switch more often?
Also is there a way to see which thread is being processed by which processor?

I’ve verified that both threads are running as separate threads using a debugger.

One thread is created using

this.executor.Executors.newSingleThreadExecutor();

And tasks are submitted using

executor.submit(new Task2(..));

The other thread is legacy code that manages it’s own queue:

private final BlockingQueue<...> workQueue = new LinkedBlockingQueue<...>();
....
public void submit(Task1 task) {
    workQueue.add(task);
}

....

    public void run() {
    while (alive){
        try{
            Task1 task = workQueue.take();
                            processwork(task);
                    }
....
  • 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-15T10:07:18+00:00Added an answer on June 15, 2026 at 10:07 am

    After more analysis I found the delay was caused earlier (before submitting) by another thread that the two tasks share.

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

Sidebar

Related Questions

Problem description After a while of running my java server application I am experiencing
i notice one nice things that a amazon provide that is load pdf data
Apparently MapReduce queries are one of the slowest things one can do in MongoDB
One of the things that block objects, introduced in Snow Leopard, are good for
One of the things I would like to follow is to stick to the
One of the things I love is the new Android Favorites Contact screen: I
This is one of those things that you read once, say aha! and then
I am looking for one of 2 things, Test Driven Development, or Architecture Trainings
Recently I found out that there are several things that one can do to
For an art project, one of the things I'll be doing is zooming in

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.