boB Gage wrote:
Upgraded M4 to M5, but nothing changed. Downloaded source, grabbed some extra debug and actually have identified the locations the threads are stuck at.

Of the two threads left behind in each discovery attempt, using M5 line numbers:

* The "idleStatusChecker" thread is inside the Thread.sleep(1000) call at line 108 of org.apache.mina.core.session.IdleStatusChecker.java. * The numbered thread is inside the writeMonitor.wait() call at line 154 of org.apache.mina.transport.serial.SerialSessionImpl.java
...
I'm new to Java, so might be misinterpreting this.... but, this is what I see when I search out writeMonitor

class SerialSessionImpl
...
   private final Object writeMonitor = new Object();
...
   private class WriteWorker extends Thread {
       @Override
       public void run() {
           while (isConnected() && !isClosing()) {
               flushWrites();

               // wait for more data
               synchronized (writeMonitor) {
                   try {
writeMonitor.wait(); <<<<<<< This is the wait referenced above (line 154)
                   } catch (InterruptedException e) {
                       log.error("InterruptedException", e);
                   }
               }
           }
       }
   }
...
private class SerialIoProcessor implements IoProcessor<SerialSessionImpl> {
...
       public void flush(SerialSessionImpl session) {
           if (writeWorker == null) {
               writeWorker = new WriteWorker();
               writeWorker.start();
           } else {
               synchronized (writeMonitor) {
                   writeMonitor.notifyAll();
               }
           }
       }
...
}


All writeMonitor references from the file are included above.

Don't the two "synchronized (writeMonitor)" clauses ensure that no two tasks can execute the enclosed commands at the same time?

Wouldn't that mean that no one task can notify the other(s) while any other task is waiting for said notification?? I think it also means no two classes can get triggered by the same notification (ie. you couldn't get two waiters, first would wait, rest would block until synchronized).

boB


PS... Are my messages actually getting through?? I haven't seen a reply to any of my own queries to this list, but I've been stumped, I coulda stumped others too. :-)


Hi Bob,

You might want to consider using the rxtx-2.2pre2 binaries available here:

http://rxtx.qbang.org/wiki/index.php/Download

Best,
Johnny

Reply via email to