• Post Reply Bookmark Topic Watch Topic
  • New Topic

Common thread issue?

 
James Bacon
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was wondering if this was a common problem that may have been resolved or if you can help me or point me in the right direction into resolving this.
In Java's serialEvent method, I read the data and place it in a buffer large enough to hold the serial input. Immediately after that, I call a parse method to parse the buffer. What I see happening is the serialEvent gets called a lot and the parse method doesn't finish because of the next serialEvent. I would like for the parse method to finish completely before the next serialEvent is processed.
Any suggestions or ideas would greatly be appreciated.


James Bacon
 
James Bacon
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It turns out that I had a thread race condition with my code. After reviewing java's tutorial on threading web page, I was able to achieve synchronized threads.
James Bacon
 
chen leon
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's happened to me.
Could you put your solution here?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!