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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:51:17+00:00 2026-05-11T09:51:17+00:00

There seems to be a lot of fuss about multicore and java. While some

  • 0

There seems to be a lot of fuss about multicore and java. While some people say that java support is not good enough, it definitely seems to be an area to look forward to. There seems to be many techniques to improve performance of concurrent programs.

Any tips/advices about programming in a multi core scenario is appreciated.

  • 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. 2026-05-11T09:51:18+00:00Added an answer on May 11, 2026 at 9:51 am

    Look into the new Java concurrency facilities (in the java.util.concurrent package) which have been added in Java 5. It provides functionality that is more high-level than regular Threads which will make it easier (and less error-prone) to write concurrent applications. The Lesson: Concurrency of The Java Tutorials would be a good place to start.

    So far, I’ve only used the ExecutorService, which allows can produce thread pools, to which new tasks can be handed off in units of Runnables or Callables (which can return values after execution as Futures), and the actual threading code is handled by the ExecutorService.

    For example, performing some calculation using a thread pool of 2 threads, and getting the result can be as simple as:

    ExecutorService es = Executors.newFixedThreadPool(2);  Future f1 = es.submit(new Callable<Integer>() {     public Integer call()     {         // Do some processing...         return someInteger;     } });  Future f2 = es.submit(new Callable<Integer>() {     public Integer call()     {         // Do some processing...         return someInteger;     } });  Integer firstInteger = f1.get(); Integer secondInteger = f2.get(); 

    In the above (untested) code, all I have to worry about is making a couple of Callables and submiting it to the ExecutorService and later on, using the Futures to retrieve the result.

    The catch is, once the get method of the Future is called, if the processing isn’t complete, the program will stop until the result of the Future can be retrieved. So, in this example, even if the result of f2 is available before f1, the program will wait until the result of f1 is available.

    In terms of reading material, on my list of books to purchase soon is Java Concurrency in Practice by Brian Goetz, which comes up often when concurrency in Java is brought up.

    The Concurrency Utilities page from the Java 5 documentation has more information as well.

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

Sidebar

Ask A Question

Stats

  • Questions 300k
  • Answers 300k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Please check the BSMaster.Count value after it being populated. The… May 13, 2026 at 7:53 pm
  • Editorial Team
    Editorial Team added an answer SELECT MAX(datecol) FROM sometable GROUP BY YEAR(datecol), MONTH(datecol); The group… May 13, 2026 at 7:53 pm
  • Editorial Team
    Editorial Team added an answer Big problem, simple solution (after working hours on this). We… May 13, 2026 at 7:53 pm

Related Questions

I am constructing a webcomic site, but the chapter order has changed significantly. I
There seems to be a lot of heated discussion on the net about the
There seems to be a lot of stress/load testing tool that support AJAX. I
There seems to be a lot of press regarding the announcement that Intellij is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.