Bookmark Topic Watch Topic
  • New Topic

thread syncronization

 
yalew sitote
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Report post to moderator
we are writing a program which sends data on the a
serialport and accepts data at the same time and
we want to synchronize it that is when data is writing
on the port the recieving buffer to wait and viceversa
but our code dosenot work please if you can you give as
a hint how to syncronize to write and read data
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • Report post to moderator
Are reading and writing operations done by different threads?

If so, make the reading and the writing operations part of a shared object and simply sinchronize the methods for reading and writing. That way you will make sure only one thread a time can be reading or writing to the underlaying streams?
[ May 11, 2006: Message edited by: Edwin Dalorzo ]
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,

Welcome to JavaRanch!

It appears that someone in your group or class has already been discussing this here, and has already gotten some of the answers. Instead of starting this stimulating discussion all over again, let's just continue it on that thread, OK?
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!