• Advertisement
Sign in to follow this  

[java] Blocking IO

This topic is 3953 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

To stop the Input from blocking the loop, i put it in its own thread where it informs the user when data has arrived that way then they can grab it. Is this okay ? Or will I see random problems in this design

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by bgilb
To stop the Input from blocking the loop, i put it in its own thread where it informs the user when data has arrived that way then they can grab it. Is this okay ? Or will I see random problems in this design


The problem with using threads in java is that many people do not understand how to correctly write multi-threaded code. Random problems could be problems with two threads sharing the same resorce. Are you having random problems, or are you wondering about the design?

If you have a long task that is blocking the user interface, there may be nothing wrong with just using the SwingWorker class. But that all depends on what you are doing?

Read through this tutorial and see if you have any more questions.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement