Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Thread(Thread Synchronization)
Thread [message #1477222] Mon, 17 November 2014 18:30 Go to next message
Omid Roozmand is currently offline Omid RoozmandFriend
Messages: 1
Registered: November 2014
Junior Member
Hello All,

I have two threads, one generates data based on some decision process (A) and another use the data to plot it (B). The problem occurs when there is no data to plot. What is the best way to synchronize these two threads? Using sleep, or wait/notify?
Re: Thread [message #1477390 is a reply to message #1477222] Mon, 17 November 2014 21:46 Go to previous message
Eclipse UserFriend
Not really the place to ask general java questions (try StackOverflow.com). but to help... try BlockingQueue

https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/BlockingQueue.html

On 11/17/2014 2:46 PM, Omid Roozmand wrote:
> Hello All,
> I have two threads, one generates data based on some decision process (A) and another use the data to plot it (B). The problem occurs when there is no data to plot. What is the best way to synchronize
> these two threads? Using sleep, or wait/notify?
Previous Topic:Apache felix GoGo shell doesn't work, can't read commands properly
Next Topic:Java EE Webtools installation in Eclipse Luna for PHP
Goto Forum:
  


Current Time: Mon Nov 30 00:02:55 GMT 2020

Powered by FUDForum. Page generated in 0.02076 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top