This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 269934

Summary: Terminal creates two threads per each instance
Product: cnd Reporter: ilia
Component: TerminalemulatorAssignee: ilia
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: Dev   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description ilia 2017-02-27 10:03:04 UTC
Each Terminal instance creates two StreamTerm.OutputMonitor threads to read underlying process' output/error streams. Since user usually has n > 1 terminals to work with (most time I have 3-5 opened) 2*n threads are created. Each thread blocks when new data is available until EDT is able to handle this event.

OutputMonitor::run()
...
SwingUtilities.invokeAndWait(tramp);


There should be a better way to handle n terminals (without creating too much threads). Maybe it worths looking to java.nio?