Commit e353efd2 authored by Adam Knapp's avatar Adam Knapp

Limiting thread creation #402

Signed-off-by: Adam Knapp's avatarAdam Knapp <adam.knapp@ericsson.com>
parent f562fcff
...@@ -22,7 +22,9 @@ import java.util.concurrent.atomic.AtomicInteger; ...@@ -22,7 +22,9 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.SubMonitor; import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.common.logging.ErrorReporter;
import org.eclipse.titan.designer.AST.Assignment; import org.eclipse.titan.designer.AST.Assignment;
import org.eclipse.titan.designer.AST.Module; import org.eclipse.titan.designer.AST.Module;
...@@ -30,6 +32,8 @@ import org.eclipse.titan.designer.AST.TTCN3.definitions.TTCN3Module; ...@@ -30,6 +32,8 @@ import org.eclipse.titan.designer.AST.TTCN3.definitions.TTCN3Module;
import org.eclipse.titan.designer.consoles.TITANDebugConsole; import org.eclipse.titan.designer.consoles.TITANDebugConsole;
import org.eclipse.titan.designer.core.LoadBalancingUtilities; import org.eclipse.titan.designer.core.LoadBalancingUtilities;
import org.eclipse.titan.designer.parsers.CompilationTimeStamp; import org.eclipse.titan.designer.parsers.CompilationTimeStamp;
import org.eclipse.titan.designer.preferences.PreferenceConstants;
import org.eclipse.titan.designer.productUtilities.ProductConstants;
/** /**
* Helper class to check broken parts. * Helper class to check broken parts.
...@@ -93,18 +97,30 @@ public final class BrokenPartsChecker { ...@@ -93,18 +97,30 @@ public final class BrokenPartsChecker {
// process the modules one-by-one // process the modules one-by-one
final long absoluteStart = System.nanoTime(); final long absoluteStart = System.nanoTime();
// When enabled do a quick parallel checking on the modules, where it is possible. final int availableProcessors = Runtime.getRuntime().availableProcessors();
// 2 modules can be checked in parallel if the codes to be checked do not overlap. final IPreferencesService prefs = Platform.getPreferencesService();
// Please note, that this will not let all modules be processed in parallel, final int processingUnitsToUse = prefs.getInt(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.PROCESSINGUNITSTOUSE,
// modules in import loops (and all modules depending on them) have to be checked in the single threaded way. availableProcessors, null);
final ExecutorService executor = Executors.newCachedThreadPool(new ThreadFactory() { final boolean limitAllThreadCreation = prefs.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER,
PreferenceConstants.LIMITALLTHREADCREATION, false, null);
final ThreadFactory threadFactory = new ThreadFactory() {
@Override @Override
public Thread newThread(final Runnable r) { public Thread newThread(final Runnable r) {
final Thread t = new Thread(r); final Thread t = new Thread(r);
t.setPriority(LoadBalancingUtilities.getThreadPriority()); t.setPriority(LoadBalancingUtilities.getThreadPriority());
return t; return t;
} }
}); };
// When enabled do a quick parallel checking on the modules, where it is possible.
// 2 modules can be checked in parallel if the codes to be checked do not overlap.
// Please note, that this will not let all modules be processed in parallel,
// modules in import loops (and all modules depending on them) have to be checked in the single threaded way.
ExecutorService executor;
if (limitAllThreadCreation) {
executor = Executors.newFixedThreadPool(processingUnitsToUse, threadFactory);
} else {
executor = Executors.newCachedThreadPool(threadFactory);
}
final AtomicInteger activeExecutorCount = new AtomicInteger(0); final AtomicInteger activeExecutorCount = new AtomicInteger(0);
final List<Module> modulesToCheckCopy = new ArrayList<Module>(modulesToCheck); final List<Module> modulesToCheckCopy = new ArrayList<Module>(modulesToCheck);
......
...@@ -83,7 +83,7 @@ public class LoadFromTpd implements IApplication { ...@@ -83,7 +83,7 @@ public class LoadFromTpd implements IApplication {
try { try {
final TpdImporter tpdImporter = new TpdImporter(null, true); final TpdImporter tpdImporter = new TpdImporter(null, true);
final List<IProject> projectsCreated = new ArrayList<IProject>(); final List<IProject> projectsCreated = new ArrayList<IProject>();
result = tpdImporter.internalFinish(projectFiles[0], false, false, projectsCreated, monitor, null); result = tpdImporter.internalFinish(projectFiles[0], false, false, false, projectsCreated, monitor, null);
} catch (Exception e) { } catch (Exception e) {
ErrorReporter.logExceptionStackTrace(e); ErrorReporter.logExceptionStackTrace(e);
result = false; result = false;
......
...@@ -34,6 +34,7 @@ import org.eclipse.core.runtime.Path; ...@@ -34,6 +34,7 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.QualifiedName; import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.common.logging.ErrorReporter;
import org.eclipse.titan.common.path.PathConverter; import org.eclipse.titan.common.path.PathConverter;
import org.eclipse.titan.designer.commonFilters.ResourceExclusionHelper; import org.eclipse.titan.designer.commonFilters.ResourceExclusionHelper;
...@@ -110,14 +111,26 @@ public final class SymbolicLinkHandler { ...@@ -110,14 +111,26 @@ public final class SymbolicLinkHandler {
PreferenceConstants.DISPLAYDEBUGINFORMATION, false, null); PreferenceConstants.DISPLAYDEBUGINFORMATION, false, null);
final CountDownLatch latch = new CountDownLatch(files.size()); final CountDownLatch latch = new CountDownLatch(files.size());
final ExecutorService executor = Executors.newCachedThreadPool(new ThreadFactory() { final int availableProcessors = Runtime.getRuntime().availableProcessors();
final IPreferencesService prefs = Platform.getPreferencesService();
final int processingUnitsToUse = prefs.getInt(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.PROCESSINGUNITSTOUSE,
availableProcessors, null);
final boolean limitAllThreadCreation = prefs.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER,
PreferenceConstants.LIMITALLTHREADCREATION, false, null);
final ThreadFactory threadFactory = new ThreadFactory() {
@Override @Override
public Thread newThread(final Runnable r) { public Thread newThread(final Runnable r) {
final Thread t = new Thread(r); final Thread t = new Thread(r);
t.setPriority(LoadBalancingUtilities.getThreadPriority()); t.setPriority(LoadBalancingUtilities.getThreadPriority());
return t; return t;
} }
}); };
ExecutorService executor;
if (limitAllThreadCreation) {
executor = Executors.newFixedThreadPool(processingUnitsToUse, threadFactory);
} else {
executor = Executors.newCachedThreadPool(threadFactory);
}
for (final IFile file : files.values()) { for (final IFile file : files.values()) {
// We want makefile to be symlinked // We want makefile to be symlinked
...@@ -392,14 +405,26 @@ public final class SymbolicLinkHandler { ...@@ -392,14 +405,26 @@ public final class SymbolicLinkHandler {
monitor.beginTask(CREATING_OUTDATED_LINK_REMOVAL, files.size()); monitor.beginTask(CREATING_OUTDATED_LINK_REMOVAL, files.size());
final CountDownLatch latch = new CountDownLatch(files.size()); final CountDownLatch latch = new CountDownLatch(files.size());
final ExecutorService executor = Executors.newCachedThreadPool(new ThreadFactory() { final int availableProcessors = Runtime.getRuntime().availableProcessors();
final IPreferencesService prefs = Platform.getPreferencesService();
final int processingUnitsToUse = prefs.getInt(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.PROCESSINGUNITSTOUSE,
availableProcessors, null);
final boolean limitAllThreadCreation = prefs.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER,
PreferenceConstants.LIMITALLTHREADCREATION, false, null);
final ThreadFactory threadFactory = new ThreadFactory() {
@Override @Override
public Thread newThread(final Runnable r) { public Thread newThread(final Runnable r) {
final Thread t = new Thread(r); final Thread t = new Thread(r);
t.setPriority(LoadBalancingUtilities.getThreadPriority()); t.setPriority(LoadBalancingUtilities.getThreadPriority());
return t; return t;
} }
}); };
ExecutorService executor;
if (limitAllThreadCreation) {
executor = Executors.newFixedThreadPool(processingUnitsToUse, threadFactory);
} else {
executor = Executors.newCachedThreadPool(threadFactory);
}
for (final String key : files.keySet()) { for (final String key : files.keySet()) {
executor.execute(new Runnable() { executor.execute(new Runnable() {
@Override @Override
...@@ -469,14 +494,26 @@ public final class SymbolicLinkHandler { ...@@ -469,14 +494,26 @@ public final class SymbolicLinkHandler {
monitor.beginTask(CREATING_OUTDATED_LINK_REMOVAL, files.size()); monitor.beginTask(CREATING_OUTDATED_LINK_REMOVAL, files.size());
final CountDownLatch latch = new CountDownLatch(files.size()); final CountDownLatch latch = new CountDownLatch(files.size());
final ExecutorService executor = Executors.newCachedThreadPool(new ThreadFactory() { final int availableProcessors = Runtime.getRuntime().availableProcessors();
final IPreferencesService prefs = Platform.getPreferencesService();
final int processingUnitsToUse = prefs.getInt(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.PROCESSINGUNITSTOUSE,
availableProcessors, null);
final boolean limitAllThreadCreation = prefs.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER,
PreferenceConstants.LIMITALLTHREADCREATION, false, null);
final ThreadFactory threadFactory = new ThreadFactory() {
@Override @Override
public Thread newThread(final Runnable r) { public Thread newThread(final Runnable r) {
final Thread t = new Thread(r); final Thread t = new Thread(r);
t.setPriority(LoadBalancingUtilities.getThreadPriority()); t.setPriority(LoadBalancingUtilities.getThreadPriority());
return t; return t;
} }
}); };
ExecutorService executor;
if (limitAllThreadCreation) {
executor = Executors.newFixedThreadPool(processingUnitsToUse, threadFactory);
} else {
executor = Executors.newCachedThreadPool(threadFactory);
}
for (final Map.Entry<String, IFile> entry : files.entrySet()) { for (final Map.Entry<String, IFile> entry : files.entrySet()) {
executor.execute(new Runnable() { executor.execute(new Runnable() {
@Override @Override
......
...@@ -39,6 +39,7 @@ import org.eclipse.core.runtime.NullProgressMonitor; ...@@ -39,6 +39,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.QualifiedName; import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.titan.common.logging.ErrorReporter; import org.eclipse.titan.common.logging.ErrorReporter;
import org.eclipse.titan.common.path.PathConverter; import org.eclipse.titan.common.path.PathConverter;
import org.eclipse.titan.common.path.PathUtil; import org.eclipse.titan.common.path.PathUtil;
...@@ -239,14 +240,26 @@ public final class InternalMakefileGenerator { ...@@ -239,14 +240,26 @@ public final class InternalMakefileGenerator {
return; return;
} }
final ExecutorService executor = Executors.newCachedThreadPool(new ThreadFactory() { final int availableProcessors = Runtime.getRuntime().availableProcessors();
final IPreferencesService prefs = Platform.getPreferencesService();
final int processingUnitsToUse = prefs.getInt(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.PROCESSINGUNITSTOUSE,
availableProcessors, null);
final boolean limitAllThreadCreation = prefs.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER,
PreferenceConstants.LIMITALLTHREADCREATION, false, null);
final ThreadFactory threadFactory = new ThreadFactory() {
@Override @Override
public Thread newThread(final Runnable r) { public Thread newThread(final Runnable r) {
final Thread t = new Thread(r); final Thread t = new Thread(r);
t.setPriority(LoadBalancingUtilities.getThreadPriority()); t.setPriority(LoadBalancingUtilities.getThreadPriority());
return t; return t;
} }
}); };
ExecutorService executor;
if (limitAllThreadCreation) {
executor = Executors.newFixedThreadPool(processingUnitsToUse, threadFactory);
} else {
executor = Executors.newCachedThreadPool(threadFactory);
}
final CountDownLatch latch = new CountDownLatch(ttcn3Modules.size() + ttcnppModules.size() + ttcn3IncludeFiles.size() + asn1modules.size() + userFiles.size() + otherFiles.size() final CountDownLatch latch = new CountDownLatch(ttcn3Modules.size() + ttcnppModules.size() + ttcn3IncludeFiles.size() + asn1modules.size() + userFiles.size() + otherFiles.size()
+ baseDirectories.size() + additionallyIncludedFolders.size() + etsName != null ? 1 : 0); + baseDirectories.size() + additionallyIncludedFolders.size() + etsName != null ? 1 : 0);
......
...@@ -767,14 +767,26 @@ public final class ProjectSourceParser { ...@@ -767,14 +767,26 @@ public final class ProjectSourceParser {
try { try {
final ConcurrentLinkedQueue<IProject> tobeSemanticallyAnalyzed = new ConcurrentLinkedQueue<IProject>(); final ConcurrentLinkedQueue<IProject> tobeSemanticallyAnalyzed = new ConcurrentLinkedQueue<IProject>();
final ExecutorService executor = Executors.newCachedThreadPool(new ThreadFactory() { final int availableProcessors = Runtime.getRuntime().availableProcessors();
final IPreferencesService prefs = Platform.getPreferencesService();
final int processingUnitsToUse = prefs.getInt(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.PROCESSINGUNITSTOUSE,
availableProcessors, null);
final boolean limitAllThreadCreation = prefs.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER,
PreferenceConstants.LIMITALLTHREADCREATION, false, null);
final ThreadFactory threadFactory = new ThreadFactory() {
@Override @Override
public Thread newThread(final Runnable r) { public Thread newThread(final Runnable r) {
final Thread t = new Thread(r); final Thread t = new Thread(r);
t.setPriority(LoadBalancingUtilities.getThreadPriority()); t.setPriority(LoadBalancingUtilities.getThreadPriority());
return t; return t;
} }
}); };
ExecutorService executor;
if (limitAllThreadCreation) {
executor = Executors.newFixedThreadPool(processingUnitsToUse, threadFactory);
} else {
executor = Executors.newCachedThreadPool(threadFactory);
}
final CountDownLatch latch = new CountDownLatch(tobeAnalyzed.size()); final CountDownLatch latch = new CountDownLatch(tobeAnalyzed.size());
for (final IProject tempProject : tobeAnalyzed) { for (final IProject tempProject : tobeAnalyzed) {
executor.execute(new Runnable() { executor.execute(new Runnable() {
......
...@@ -405,14 +405,26 @@ public final class ProjectSourceSyntacticAnalyzer { ...@@ -405,14 +405,26 @@ public final class ProjectSourceSyntacticAnalyzer {
final SubMonitor parseProgress = SubMonitor.convert(progress, ttcn3FilesToCheck.size() + asn1FilesToCheck.size()); final SubMonitor parseProgress = SubMonitor.convert(progress, ttcn3FilesToCheck.size() + asn1FilesToCheck.size());
parseProgress.setTaskName("Parse"); parseProgress.setTaskName("Parse");
final ExecutorService executor = Executors.newCachedThreadPool(new ThreadFactory() { final int availableProcessors = Runtime.getRuntime().availableProcessors();
final IPreferencesService prefs = Platform.getPreferencesService();
final int processingUnitsToUse = prefs.getInt(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.PROCESSINGUNITSTOUSE,
availableProcessors, null);
final boolean limitAllThreadCreation = prefs.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER,
PreferenceConstants.LIMITALLTHREADCREATION, false, null);
final ThreadFactory threadFactory = new ThreadFactory() {
@Override @Override
public Thread newThread(final Runnable r) { public Thread newThread(final Runnable r) {
final Thread t = new Thread(r); final Thread t = new Thread(r);
t.setPriority(LoadBalancingUtilities.getThreadPriority()); t.setPriority(LoadBalancingUtilities.getThreadPriority());
return t; return t;
} }
}); };
ExecutorService executor;
if (limitAllThreadCreation) {
executor = Executors.newFixedThreadPool(processingUnitsToUse, threadFactory);
} else {
executor = Executors.newCachedThreadPool(threadFactory);
}
final TemporalParseData[] tempResults = new TemporalParseData[ttcn3FilesToCheck.size() + asn1FilesToCheck.size()]; final TemporalParseData[] tempResults = new TemporalParseData[ttcn3FilesToCheck.size() + asn1FilesToCheck.size()];
int nofFilesProcessed = 0; int nofFilesProcessed = 0;
...@@ -648,15 +660,26 @@ public final class ProjectSourceSyntacticAnalyzer { ...@@ -648,15 +660,26 @@ public final class ProjectSourceSyntacticAnalyzer {
final SubMonitor parseProgress = SubMonitor.convert(progress, ttcn3FilesToCheck.size() + asn1FilesToCheck.size()); final SubMonitor parseProgress = SubMonitor.convert(progress, ttcn3FilesToCheck.size() + asn1FilesToCheck.size());
parseProgress.setTaskName("Syntactically analyzing"); parseProgress.setTaskName("Syntactically analyzing");
final int availableProcessors = Runtime.getRuntime().availableProcessors();
final ExecutorService executor = Executors.newCachedThreadPool(new ThreadFactory() { final IPreferencesService prefs = Platform.getPreferencesService();
final int processingUnitsToUse = prefs.getInt(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.PROCESSINGUNITSTOUSE,
availableProcessors, null);
final boolean limitAllThreadCreation = prefs.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER,
PreferenceConstants.LIMITALLTHREADCREATION, false, null);
final ThreadFactory threadFactory = new ThreadFactory() {
@Override @Override
public Thread newThread(final Runnable r) { public Thread newThread(final Runnable r) {
final Thread t = new Thread(r); final Thread t = new Thread(r);
t.setPriority(LoadBalancingUtilities.getThreadPriority()); t.setPriority(LoadBalancingUtilities.getThreadPriority());
return t; return t;
} }
}); };
ExecutorService executor;
if (limitAllThreadCreation) {
executor = Executors.newFixedThreadPool(processingUnitsToUse, threadFactory);
} else {
executor = Executors.newCachedThreadPool(threadFactory);
}
final TemporalParseData[] tempResults = new TemporalParseData[ttcn3FilesToCheck.size() + asn1FilesToCheck.size()]; final TemporalParseData[] tempResults = new TemporalParseData[ttcn3FilesToCheck.size() + asn1FilesToCheck.size()];
int nofFilesProcessed = 0; int nofFilesProcessed = 0;
......
...@@ -27,6 +27,7 @@ public final class PreferenceConstants { ...@@ -27,6 +27,7 @@ public final class PreferenceConstants {
public static final String RECONCILERTIMEOUT = ProductConstants.PRODUCT_ID_DESIGNER + ".reconcilerTimeout"; public static final String RECONCILERTIMEOUT = ProductConstants.PRODUCT_ID_DESIGNER + ".reconcilerTimeout";
public static final String ENABLEREALTIMEEXTENSION = ProductConstants.PRODUCT_ID_DESIGNER + ".enableRealtimeExtension"; public static final String ENABLEREALTIMEEXTENSION = ProductConstants.PRODUCT_ID_DESIGNER + ".enableRealtimeExtension";
public static final String PROCESSINGUNITSTOUSE = ProductConstants.PRODUCT_ID_DESIGNER + ".processingUnitsToUse"; public static final String PROCESSINGUNITSTOUSE = ProductConstants.PRODUCT_ID_DESIGNER + ".processingUnitsToUse";
public static final String LIMITALLTHREADCREATION = ProductConstants.PRODUCT_ID_DESIGNER + ".limitAllThreadCreation";
//Actions on console before build //Actions on console before build
public static final String CONSOLE_ACTION_BEFORE_BUILD = ProductConstants.PRODUCT_ID_DESIGNER + ".consoleActionBeforeBuild"; public static final String CONSOLE_ACTION_BEFORE_BUILD = ProductConstants.PRODUCT_ID_DESIGNER + ".consoleActionBeforeBuild";
......
...@@ -53,6 +53,7 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer { ...@@ -53,6 +53,7 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
preferenceStore.setDefault(PreferenceConstants.RECONCILERTIMEOUT, 1); preferenceStore.setDefault(PreferenceConstants.RECONCILERTIMEOUT, 1);
preferenceStore.setDefault(PreferenceConstants.ENABLEREALTIMEEXTENSION, false); preferenceStore.setDefault(PreferenceConstants.ENABLEREALTIMEEXTENSION, false);
preferenceStore.setDefault(PreferenceConstants.PROCESSINGUNITSTOUSE, PreferenceConstantValues.AVAILABLEPROCESSORS); preferenceStore.setDefault(PreferenceConstants.PROCESSINGUNITSTOUSE, PreferenceConstantValues.AVAILABLEPROCESSORS);
preferenceStore.setDefault(PreferenceConstants.LIMITALLTHREADCREATION, false);
preferenceStore.setDefault(PreferenceConstants.CONSOLE_ACTION_BEFORE_BUILD, PreferenceConstantValues.BEFORE_BUILD_PRINT_CONSOLE_DELIMITERS); preferenceStore.setDefault(PreferenceConstants.CONSOLE_ACTION_BEFORE_BUILD, PreferenceConstantValues.BEFORE_BUILD_PRINT_CONSOLE_DELIMITERS);
// content assistance // content assistance
......
...@@ -148,6 +148,7 @@ public final class TITANPreferencePage extends FieldEditorPreferencePage impleme ...@@ -148,6 +148,7 @@ public final class TITANPreferencePage extends FieldEditorPreferencePage impleme
private BooleanFieldEditor reportProgramErrorWithMarker; private BooleanFieldEditor reportProgramErrorWithMarker;
private BooleanFieldEditor treatOnTheFlyErrorsFatalforBuild; private BooleanFieldEditor treatOnTheFlyErrorsFatalforBuild;
private IntegerFieldEditor processingUnitsToUse; private IntegerFieldEditor processingUnitsToUse;
private BooleanFieldEditor limitAllThreadCreation;
private BooleanFieldEditor displayDebugPreferences;//FIXME: remove this functionality! private BooleanFieldEditor displayDebugPreferences;//FIXME: remove this functionality!
private Composite comp; private Composite comp;
...@@ -162,7 +163,7 @@ public final class TITANPreferencePage extends FieldEditorPreferencePage impleme ...@@ -162,7 +163,7 @@ public final class TITANPreferencePage extends FieldEditorPreferencePage impleme
private class CreateNewLicense extends SelectionAdapter { private class CreateNewLicense extends SelectionAdapter {
@Override @Override
public void widgetSelected(final SelectionEvent e) { public void widgetSelected(final SelectionEvent e) {
openUrl("https://tcc-licorder.rnd.ki.sw.ericsson.se/order_form.php?type=ericsson"); openUrl("http://ttcn.ericsson.se/license");
} }
} }
...@@ -178,7 +179,7 @@ public final class TITANPreferencePage extends FieldEditorPreferencePage impleme ...@@ -178,7 +179,7 @@ public final class TITANPreferencePage extends FieldEditorPreferencePage impleme
@Override @Override
public void widgetSelected(final SelectionEvent e) { public void widgetSelected(final SelectionEvent e) {
openUrl("https://tcc-licorder.rnd.ki.sw.ericsson.se/order_form.php?type=ericsson"); //licenseID has been removed openUrl("http://ttcn.ericsson.se/license"); //licenseID has been removed
} }
} }
...@@ -422,9 +423,17 @@ public final class TITANPreferencePage extends FieldEditorPreferencePage impleme ...@@ -422,9 +423,17 @@ public final class TITANPreferencePage extends FieldEditorPreferencePage impleme
getFieldEditorParent()); getFieldEditorParent());
processingUnitsToUse.getLabelControl(getFieldEditorParent()).setToolTipText( processingUnitsToUse.getLabelControl(getFieldEditorParent()).setToolTipText(
"Maximum number of processors available right now: " + PreferenceConstantValues.AVAILABLEPROCESSORS); "Maximum number of processors available right now: " + PreferenceConstantValues.AVAILABLEPROCESSORS);
processingUnitsToUse.getTextControl(getFieldEditorParent()).setToolTipText(
"Maximum number of processors available right now: " + PreferenceConstantValues.AVAILABLEPROCESSORS);
processingUnitsToUse.setValidRange(1, PreferenceConstantValues.AVAILABLEPROCESSORS + 1); processingUnitsToUse.setValidRange(1, PreferenceConstantValues.AVAILABLEPROCESSORS + 1);
addField(processingUnitsToUse); addField(processingUnitsToUse);
limitAllThreadCreation = new BooleanFieldEditor(PreferenceConstants.LIMITALLTHREADCREATION, "Limit maximum number of other parallel processes to this number",
getFieldEditorParent());
limitAllThreadCreation.getDescriptionControl(getFieldEditorParent()).setToolTipText(
"This might need to turn on when the OS runs out of threads, i.e. when 'OutOfMemoryError: unable to create native thread' exception is thrown");
addField(limitAllThreadCreation);
displayDebugPreferences = new BooleanFieldEditor(PreferenceConstants.DEBUG_PREFERENCE_PAGE_ENABLED, "Display debug preferences", displayDebugPreferences = new BooleanFieldEditor(PreferenceConstants.DEBUG_PREFERENCE_PAGE_ENABLED, "Display debug preferences",
getFieldEditorParent()); getFieldEditorParent());
addField(displayDebugPreferences); addField(displayDebugPreferences);
......
...@@ -22,6 +22,8 @@ import org.eclipse.swt.widgets.Composite; ...@@ -22,6 +22,8 @@ import org.eclipse.swt.widgets.Composite;
class NewTITANProjectImportOptionsPage extends WizardPage { class NewTITANProjectImportOptionsPage extends WizardPage {
private static final String TITLE = "TITAN Project importation options"; private static final String TITLE = "TITAN Project importation options";
private Button limitImportProcesses;
private boolean islimitImportProcesses = false;
private Button openPropertiesForAllImports; private Button openPropertiesForAllImports;
private boolean isOpenPropertiesForAllImports = false; private boolean isOpenPropertiesForAllImports = false;
private Button skipExistingProjects; private Button skipExistingProjects;
...@@ -33,7 +35,7 @@ class NewTITANProjectImportOptionsPage extends WizardPage { ...@@ -33,7 +35,7 @@ class NewTITANProjectImportOptionsPage extends WizardPage {
@Override @Override
public String getDescription() { public String getDescription() {
return "Finetune the ammount of data saved about the project"; return "Finetune the amount of data saved about the project";
} }
@Override @Override
...@@ -41,6 +43,10 @@ class NewTITANProjectImportOptionsPage extends WizardPage { ...@@ -41,6 +43,10 @@ class NewTITANProjectImportOptionsPage extends WizardPage {
return TITLE; return TITLE;
} }
public boolean islimitImportProcesses() {
return islimitImportProcesses;
}
public boolean isOpenPropertiesForAllImports() { public boolean isOpenPropertiesForAllImports() {
return isOpenPropertiesForAllImports; return isOpenPropertiesForAllImports;
} }
...@@ -82,6 +88,20 @@ class NewTITANProjectImportOptionsPage extends WizardPage { ...@@ -82,6 +88,20 @@ class NewTITANProjectImportOptionsPage extends WizardPage {
} }
}); });
limitImportProcesses = new Button(pageComposite, SWT.CHECK);
limitImportProcesses.setText("Limit the number of parallel import processes");
limitImportProcesses.setToolTipText("This might need to turn on when the OS runs out of threads, "
+ "i.e. when 'OutOfMemoryError: unable to create native thread' exception is thrown");
limitImportProcesses.setEnabled(true);
limitImportProcesses.setSelection(false);
islimitImportProcesses = false;
limitImportProcesses.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
islimitImportProcesses = limitImportProcesses.getSelection();
}
});
setControl(pageComposite); setControl(pageComposite);
}