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 - Terminal creates two threads per each instance
Summary: Terminal creates two threads per each instance
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Terminalemulator (show other bugs)
Version: Dev
Hardware: All All
: P3 normal (vote)
Assignee: ilia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-27 10:03 UTC by ilia
Modified: 2017-02-27 10:03 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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?