Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Deadlock/starvation handling
Deadlock/starvation handling [message #895218] Thu, 12 July 2012 07:48 Go to next message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
Hello,

Does e4 provide any means to help handling deadlocks in worker threads?

In the past two years, I've had several occasions where I couldn't start/shut down eclipse anymore because a worker thread was trying to lock something but never actually got that lock either because of a deadlock or starvation (some other worker didn't properly release the lock).

My questions:

- Is there a good tool to analyze deadlocks in worker threads?

- Is there an API or helper classes to write workers which properly time out if they can't get a lock in time?

With "tool", I mean something which helps to write meaningful bug reports. A stack dump is great but it would help if the tool would help to isolate the threads which are really blocked (i.e. omit idle ones) and it should find out which plug-in provided to code in which the worker hangs, so it can add the ID and version.

With API, I mean tooling that warns about trying to acquire locks without a timeout and maybe a "killer" thread in Eclipse which can kill dead workers. Not ideal, yes, but it's better to kill a hanging thread than risking to corrupt the workspace by killing Eclipse.

I understand that killing a thread could also corrupt the workspace but my gut feeling is that the chances here are slim: The worker thread is hanging somewhere but most likely not inside some operation which saves plug-in state to the workspace metadata.

By killing the thread, I can shut down Eclipse properly. If a worker threads blocks while I shut down, this will interrupt the other (correctly working plug-ins) from saving their state -> doom.

Comments?
Re: Deadlock/starvation handling [message #895283 is a reply to message #895218] Thu, 12 July 2012 11:31 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

e4 hasn't looked at any kind of profiling, we just use the Jobs API if we have to manage threads (but not very often).

PW


Re: Deadlock/starvation handling [message #895333 is a reply to message #895283] Thu, 12 July 2012 13:19 Go to previous messageGo to next message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
Would it be possible/make sense to extend the Jobs API to help users detect and report deadlocks?

Or at least extend the progress view to allow me to copy the list of jobs into the clipboard?
Re: Deadlock/starvation handling [message #895360 is a reply to message #895333] Thu, 12 July 2012 14:57 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

I don't know enough about deadlock detection to comment on enhancing the Jobs framework.

But the progress view could be enhanced with a command to copy out information from the org.eclipse.ui.internal.progress.JobInfo objects.

PW


Previous Topic:SimpleIDE Menus and Navigator Control
Next Topic:Eclipse 4 Application Development Book
Goto Forum:
  


Current Time: Mon Dec 22 10:38:04 GMT 2014

Powered by FUDForum. Page generated in 0.01813 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software