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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:35:36+00:00 2026-05-29T11:35:36+00:00

The easiest implementation is when we call from single class main method other classes

  • 0

The easiest implementation is when we call from single class main method other classes implementing runnable:

 public static void main(String [] args){

    // declarations ...


    receiver.start();
    player.start();


 }

Say inside receiver I have while loop which receives a packet value and I want to send that value to the second thread. How to do that?

Just to clarify I don’t yet care about one thread controlling another, I just want first thread to share values with second.

And tiny question aside – does JDK 7 Fork really dramatically increases performance for java concurrent api?

Thank You For Your Time,

  • 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-29T11:35:36+00:00Added an answer on May 29, 2026 at 11:35 am

    A simple option is to use a java.util.concurrent.atomic.AtomicReference (or one of the other Atomic... classes). Create a single instance of AtomicReference, and pass it to the code that the various threads run, and set the value from the receiver thread. The other thread(s) can then read the value at their leisure, in a thread-safe manner.

    does JDK 7 Fork really dramatically increases performance for java concurrent api?

    No, it’s just a new API to make some things easier. It’s not there to make things faster.

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

Sidebar

Related Questions

What's the fastest and easiest to read implementation of calculating the sum of digits?
The easiest way to think of my question is to think of a single,
The easiest way to explain this problem is to show you some code: Public
What would be the easiest way to separate the directory name from the file
What's the easiest way to convert a percentage to a color ranging from Green
I have a C++ class ' Expression ' with a method I'd like to
What is the easiest way to extract the original exception from an exception returned
Firstly I feel this question is not a duplicate for : Easiest implementation of
What is the easiest open source implementation of an image comparison algorithm that can
Suppose you have an interface defined in C#. What is the easiest method to

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.