F
Frank J?ger
Hi all,
I am using the javax communication API to talk to RS232. Now this
works fine by using the serialPortEventListener but I always wait for
500 ms to read/write new data. I have made my classes Runnable to put
them into threads and use synchronized to let one thread finish
reading and writing.
To control the synchronized methods I use one attribute (public
boolean) which is set true when initializing the eventListener and set
to false if the string I expect was captured.
If I start several threads (and don't wait 500 ms in between) only one
thread is processed and all others are waiting for ever. Looks like a
deadlock.
How can I resolve this. Is it o.k. to use just one parameter for
controlling all synchronized methods?
Frank
I am using the javax communication API to talk to RS232. Now this
works fine by using the serialPortEventListener but I always wait for
500 ms to read/write new data. I have made my classes Runnable to put
them into threads and use synchronized to let one thread finish
reading and writing.
To control the synchronized methods I use one attribute (public
boolean) which is set true when initializing the eventListener and set
to false if the string I expect was captured.
If I start several threads (and don't wait 500 ms in between) only one
thread is processed and all others are waiting for ever. Looks like a
deadlock.
How can I resolve this. Is it o.k. to use just one parameter for
controlling all synchronized methods?
Frank