Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Deadlocks and synchronisation

I unsuccessfully struggling against deadlocks in which conflicting threads are both CDT-controlled. What I found out, there is a lot of code in CDT that use Java and Eclipse Job locking mechanisms at the same time. This makes deadlock resolution mechanism in Eclipse just to be disabled. If you take in account that there are also many cases when synchronization objects are acquired in the opposite order, you can easily imagine that deadlocks have non-zero probability during intensively workspace updating . I also don't understand why such operation as MakeTargetManager.findTarget(...) requires finally the locking of the whole workspace (moreover, I don't understand why it needs locking at all). I believe this is not the only case of unnecessary locking. For example, invocation of CProjectDescriptionManager.getProjectDescription also does the same Please coorect me if I'm wrong.
Anyway, the question is how to deal with this problem now? Any work around?

As an example I paste call stacks for two blocked threads. The first one holds the instance of CPojectDescripionManager (acquired using Java synchronized mechanism) and needs to lock workspace (locked by scheduling rule in the second one). And vice versa...

Thread [ModalContext] (Suspended) owns: CProjectDescriptionManager (id=480) waited by: Thread [Worker-14] (Suspended) owns: Project (id=481) UILockListener.aboutToWait(Thread) line: 133 LockManager.aboutToWait(Thread) line: 107 ThreadJob.joinRun(IProgressMonitor) line: 184 ImplicitJobs.begin(ISchedulingRule, IProgressMonitor, boolean) line: 87 JobManager.beginRule(ISchedulingRule, IProgressMonitor) line: 225 CProjectDescriptionManager.runWspModification(IWorkspaceRunnable, IProgressMonitor) line: 750 CProjectDescriptionManager.saveConversion(IProject, SettingsContext, CProjectDescription, IProgressMonitor) line: 737 CProjectDescriptionManager.getProjectDescription(IProject, int) line: 556 CProjectDescriptionManager.getProjectDescription(IProject, boolean, boolean) line: 514 CProjectDescriptionManager.getProjectDescription(IProject, boolean) line: 506 CConfigBasedDescriptorManager.findDescriptor(IProject, boolean) line: 288 CConfigBasedDescriptorManager.getDescriptor(IProject, boolean) line: 200 CCorePlugin.getCProjectDescription(IProject, boolean) line: 682 ProjectTargets.translateCDTProjectToDocument() line: 304 ProjectTargets.<init>(MakeTargetManager, IProject) line: 78 MakeTargetManager.readTargets(IProject) line: 273 MakeTargetManager.findTarget(IContainer, String) line: 132 ReferencedProject.findMakeTarget(String) line: 158 ReferencedProject.setProjectBuildTargetName(String) line: 93 ReferencedProject.<init>(IProject, String, boolean) line: 77 AccessToBuildConfigsInOldFormat.loadReferencedProjectOld(Element) line: 123 AccessToBuildConfigsInOldFormat.loadProjectConfigurationOld(IProject, Element) line: 54 AccessToBuildConfigsInOldFormat.loadProjectConfigurationsOld(IProject) line: 34 ContainerProjectManager.getBuildConfigsFromContainer(IProject) line: 503 ImportWizard.collectProjectsToWorkingSets(IProject, List, String, IProgressMonitor) line: 314 ImportWizard.collectProjectsToWorkingSets(IProject, List, String, IProgressMonitor) line: 329 ImportWizard$1.run(IProgressMonitor) line: 217 ModalContext$ModalContextThread.run() line: 113 Thread [Worker-14] (Suspended) waiting for: CProjectDescriptionManager (id=480) CConfigBasedDescriptorManager.getDescriptor(IProject, boolean) line: 200 CCorePlugin.getCProjectDescription(IProject, boolean) line: 682 DefaultPathEntryStore.getRawPathEntries() line: 89 PathEntryStoreProxy.getRawPathEntries() line: 93 PathEntryManager.getRawPathEntries(ICProject) line: 620 PathEntryManager.getResolvedPathEntries(ICProject, boolean, boolean) line: 520 PathEntryManager.getResolvedPathEntries(ICProject, boolean) line: 504 PathEntryManager.getResolvedPathEntries(ICProject) line: 491 PathEntryManager.getResolveInfo(ICProject, boolean) line: 418 PathEntryConfigurationDataProvider.createData(ICConfigurationDescription, boolean) line: 295 PathEntryConfigurationDataProvider.createData(ICConfigurationDescription, CConfigurationData, boolean, boolean) line: 266 PathEntryConfigurationDataProvider.applyConfiguration(ICConfigurationDescription, ICConfigurationDescription, CConfigurationData, IProgressMonitor) line: 239 PathEntryConfigurationDataProvider(CConfigurationDataProvider).applyConfiguration(ICConfigurationDescription, ICConfigurationDescription, CConfigurationData, IModificationContext, IProgressMonitor) line: 103 CProjectDescriptionManager.applyData(CConfigurationDescriptionCache, ICConfigurationDescription, CConfigurationData, SettingsContext, IProgressMonitor) line: 1638 CConfigurationDescriptionCache.applyData(CSettingEntryFactory, SettingsContext) line: 137 CProjectDescription.applyDatas(SettingsContext) line: 217 CProjectDescriptionManager.getConvertedDescription(IProject, SettingsContext) line: 707 CProjectDescriptionManager.getProjectDescription(IProject, int) line: 546 CProjectDescriptionManager.getProjectDescription(IProject, boolean, boolean) line: 514 CProjectDescriptionManager.getProjectDescription(IProject, boolean) line: 506 PDOMManager.isFullyCreated(IProject) line: 668 PDOMManager.access$0(PDOMManager, IProject) line: 667 PDOMManager$3.run(IProgressMonitor) line: 629 Worker.run() line: 55



Back to the top